README.md
December 26, 2025 ยท View on GitHub
tmc-hello-world
CMake configurations to create minimal "Hello, world!" applications using the TooManyCooks async runtime. TMC is a header-only library and does not require or use CMake directly. CMake is used here only for example, but TMC is compatible with any build system.
There are two separate project templates here: minimal and recommended.
minimal subfolder
The absolute bare minimum necessary to build and run a TMC application:
- Download TMC using CMake FetchContent.
#define TMC_IMPLinmain.cpp
cd ./minimal
./build.sh
./build/hello_world
recommended subfolder
Adds the following additional elements:
- Standalone TMC build file
tmc_build.cpp. - Use CPM to download dependencies.
- (optional) attempt to find system
libhwloc. If found, enableTMC_USE_HWLOC. - (optional) attempt to find a system
tcmalloc,mimalloc, orjemalloc. If found, link to it. - Attempt to find system boost::asio. Otherwise, fallback to fetching standalone Asio.
- Additional example
hello_world_asiowhich returnsHello, World!over HTTP. CMakePresets.jsonwhich includes presets for Linux/Windows/Mac and Clang/GCC/MSVC.
cd ./recommended
# The default preset is 'gcc-linux-debug'. Edit build.sh to change it.
./build.sh
./build/hello_world
./build/hello_world_asio
Dependencies
- cmake
- a C++ compiler
- (optional)
hwloc,libhwloc-devandlibtcmalloc-minimal4system packages - (really optional)
libboost-all-devsystem package