Standalone demo and test project for HQCodeGen — the code generation tool from the Hokku engine. Demonstrates compile-time reflection, enum introspection, and archive-based serialization without requiring the full engine.
- CodeGen/ — Submodule containing the code generator, standalone Introspect library, Inja templates, and CMake helpers
- Demo/ — Demo application that registers reflected types, queries metadata, and serializes with PrintArchive/CountArchive
- Tests/ — Test suites validating CodeGen output (TestA: reflection, TestB: conflicts, TestC: inheritance)
- Vendor/ — FindLibClang CMake module and Conan dependency list
- CMake 3.28+
- C++23 compiler (MSVC v143+ or Clang 17+)
- LLVM/Clang 15-17 (libclang)
- [Optional] Conan 2.x (
pip install conan)
git clone --recursive <repo-url>
cd Vendor
conan install . -of Conan -b missing -s build_type=Release -c tools.cmake.cmaketoolchain:generator=Ninja
Conan\conanvcvars.bat
cmake -S . -B Build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=Conan/conan_toolchain.cmake
cmake --build Build
Build/Demo.exe
ctest --test-dir Build
| Option | Default | Description |
|---|---|---|
HQ_BUILD_DEMO |
ON |
Build the demo application |
HQ_BUILD_TESTS |
ON |
Build the test suite (requires doctest) |
HQ_GLOBAL_TYPES |
ON |
Expose hq:: type aliases (c8, u32, f32, ...) in global namespace |
HQ_USING_CONAN |
auto | Auto-detected from toolchain file; set manually if detection fails |
- This project deliberately uses single-file parsing (does not expand includes), adding support for proper parsing is a TODO
- Defines that are shadowing C++ keywords would not be reflected (for example '#define NMSPC namespace'), this is a TODO
[[Reflect]]attributes require explicit template instantiation of a Reflect function (with specific Archive types), see 'codegen.cpp_template.txt' for reference