Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game Development Toolkit

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.

What's inside

  • lib_core — foundational utilities: Result<T> error handling, Optional<T>/NotNull<T> null safety, basic math types
  • lib_inventory — engine-agnostic inventory system with a C API (inventory_c shared library) plus two pure-C example consumers
  • test_harness — cross-library integration and performance tests
  • cmake/ — shared helpers (GDTCommon.cmake) and a library scaffolder (AddNewLibrary.cmake)

Build prerequisites

  • Windows: Visual Studio 2022 Build Tools (MSVC), or MSYS2 MinGW64 (GCC) + Ninja
  • macOS: Xcode command line tools + Ninja
  • Linux: GCC or Clang + Ninja

Configure & build (presets)

Ninja (Linux / macOS / any machine with a default compiler on PATH):

  • Configure: cmake --preset ninja-debug (or ninja-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=23 or 20 at 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>)

IDE targets

  • 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 examples example_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.

Add a new library

Scaffold lib_foo with a single script call:

cmake -DNEW_LIBRARY_NAME=foo -P cmake/AddNewLibrary.cmake

This 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).)

Cleanup

Windows: powershell -ExecutionPolicy Bypass -File scripts/clean_builds.ps1 Elsewhere: delete the build/ directory.

About

Modular CMake workspace for engine-agnostic game libraries — feels like a .sln: drop lib_* in, everything wires up. Static C++ core + thin C shim per library.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages