[M3] add codegen::cmake_lists

This commit is contained in:
2026-05-08 12:44:49 +00:00
parent 384fbf6ac4
commit 4380c5181c
6 changed files with 581 additions and 0 deletions

View File

@@ -70,6 +70,14 @@ All notable changes to cargoxx will be documented in this file.
not show `buildInputs`; we add one between `nativeBuildInputs` and the
`env.NIX_CFLAGS_COMPILE` block as the natural slot for the deps that
TECH_SPEC §10 says we splice in.
- `codegen::cmake_lists(in) -> std::string` per `SPEC.md` §8 and
`TECH_SPEC.md` §9: `find_package` per dep, optional library target
with module units + private impl sources, primary binary
`<pkg>_bin` linked against the library, additional binaries from
`src/bin/`, tests with `enable_testing()` + `add_test`, examples,
and `[build]` honoring `warnings_as_errors` and `sanitizers`. Source
paths emitted relative to `build/` (i.e. prefixed with `../`).
Output is deterministic. `tests/codegen_cmake.cpp` covers 11 cases.
- SQLite overlay: `Database::open(overlay_path)` now opens (and creates,
if missing) a per-user `linkdb.sqlite` cache, applying the schema from
`SPEC.md` §9 idempotently. Default path is