Modern, modular CMake workspace designed to feel like a .sln solution in CLion/Rider:
drop a lib_* folder in the root and everything wires up automatically — the root
CMakeLists.txt auto-discovers lib_* directories, registers their tests with shared
labels, and folds them into the aggregate build targets.
Each library is a static C++ core with an optional thin C shim (bindings/) so it can
be consumed from any engine or language that can speak C. Pure-C example consumers are
built as part of the default target, so the C API can never silently rot.
lib_core— foundational utilities:Result<T>error handling,Optional<T>/NotNull<T>null safety, basic math typeslib_inventory— engine-agnostic inventory system with a C API (inventory_cshared library) plus two pure-C example consumerstest_harness— cross-library integration and performance testscmake/— shared helpers (GDTCommon.cmake) and a library scaffolder (AddNewLibrary.cmake)
- Windows: Visual Studio 2022 Build Tools (MSVC), or MSYS2 MinGW64 (GCC) + Ninja
- macOS: Xcode command line tools + Ninja
- Linux: GCC or Clang + Ninja
Ninja (Linux / macOS / any machine with a default compiler on PATH):
- Configure:
cmake --preset ninja-debug(orninja-release) - Build all libs:
cmake --build --preset build-debug - Build tests:
cmake --build --preset build-tests-debug - Run tests:
ctest --preset test-all-debug
Visual Studio 2022 (Windows):
- Configure:
cmake --preset vs2022-debug - Build:
cmake --build --preset build-vs2022-debug - Test:
ctest --preset test-all-vs2022-debug
MSYS2 MinGW64 (Windows):
- Configure:
cmake --preset msys2-mingw64-debug - Build:
cmake --build --preset build-msys2-mingw64-debug - Test:
ctest --preset test-all-msys2-mingw64-debug
Options:
- C++ standard: pass
-DGDT_CXX_STANDARD=23or20at configure time (presets default to 23) - Run tests by label:
ctest --preset test-all-debug -L unit(labels:unit,property,performance,integration,stress,lib:<name>)
- Aggregate:
build_all,build_tests,run_all - Runners:
run_tests,run_unit_tests,run_property_tests,run_performance_tests,performance_monitor - Per-library:
core,inventory,inventory_c, their*_tests, and the C API examplesexample_minimal_binding/example_engine_consumer - Integration:
test_harness
CLion: open the folder, pick the ninja-debug preset (or a Debug/Ninja profile); all
targets above are discoverable.
Scaffold lib_foo with a single script call:
cmake -DNEW_LIBRARY_NAME=foo -P cmake/AddNewLibrary.cmakeThis creates lib_foo/include/foo, lib_foo/src, lib_foo/test, and a CMakeLists that
links against core and registers its test. Add -DWITH_C_API=ON to also generate a
bindings/ C shim. Re-run the configure step and the root build picks it up — no manual
wiring.
(The same helper is callable from CMake code: include(cmake/AddNewLibrary.cmake) then
gdt_add_library(foo WITH_C_API).)
Windows: powershell -ExecutionPolicy Bypass -File scripts/clean_builds.ps1
Elsewhere: delete the build/ directory.