diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-11 08:19:05 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-11 08:19:05 +0100 |
| commit | fdf9345d5de1c951603e5da3ee8454e9efe2dc28 (patch) | |
| tree | ee0dcf35de7d2800b20faf861cd70cb168d773f8 /doc/HOWTO.md | |
| parent | 6d64674f7e3d00a9d18ec61eaf968ed37c8e849b (diff) | |
refactor: Modularize CMake build system into 10 specialized modules
Refactor monolithic 866-line CMakeLists.txt into 54-line orchestrator + 10 modules:
- DemoOptions.cmake - Build option declarations
- DemoConfig.cmake - Option implications and platform detection
- DemoCommon.cmake - Shared macros (conditional sources, size opts, linking)
- DemoDependencies.cmake - External library discovery (WGPU, GLFW)
- DemoSourceLists.cmake - Conditional source file lists
- DemoLibraries.cmake - Subsystem library targets
- DemoTools.cmake - Build tools (asset_packer, compilers)
- DemoCodegen.cmake - Code generation (assets, timeline, music)
- DemoExecutables.cmake - Main binaries (demo64k, test_demo)
- DemoTests.cmake - Test infrastructure (36 tests)
- Validation.cmake - Uniform buffer validation
Benefits:
- 94% reduction in main file size (866 → 54 lines)
- Conditional module inclusion (tests only parsed if DEMO_BUILD_TESTS=ON)
- Shared macros eliminate 200+ lines of repetition
- Clear separation of concerns
All 36 tests passing. All build modes verified.
Documentation: Created doc/CMAKE_MODULES.md with module architecture.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/HOWTO.md')
| -rw-r--r-- | doc/HOWTO.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/HOWTO.md b/doc/HOWTO.md index 140c09f..db324ec 100644 --- a/doc/HOWTO.md +++ b/doc/HOWTO.md @@ -204,9 +204,22 @@ See `doc/CNN_TEST_TOOL.md` for full documentation. --- +## Modifying Build System + +- **Add build option:** Edit `cmake/DemoOptions.cmake` +- **Add source files:** Edit `cmake/DemoSourceLists.cmake` +- **Add test:** Edit `cmake/DemoTests.cmake` +- **Add tool:** Edit `cmake/DemoTools.cmake` +- **Add library:** Edit `cmake/DemoLibraries.cmake` + +See `doc/CMAKE_MODULES.md` for full architecture and shared macros. + +--- + ## Additional Documentation - **Build System:** `doc/BUILD.md` - Multi-platform, size optimization +- **CMake Modules:** `doc/CMAKE_MODULES.md` - Module architecture, shared macros - **Tools:** `doc/TOOLS_REFERENCE.md` - spectool, coverage, Windows cross-compile - **Shaders:** `doc/SEQUENCE.md` - Timeline format, shader parameters - **3D:** `doc/3D.md` - Hybrid rendering, scene format |
