[M1] add layout::discover

This commit is contained in:
2026-05-08 11:03:44 +00:00
parent b0c54b8f5a
commit 3dc082147a
6 changed files with 373 additions and 0 deletions

View File

@@ -29,3 +29,10 @@ All notable changes to cargoxx will be documented in this file.
Dependencies are emitted alphabetically (matches Cargo). Round-trip
property is exercised by `tests/manifest_write.cpp` (9 cases).
Defaulted `operator==` on the manifest structs supports comparison.
- `cargoxx.layout` public types (`Target`, `TargetKind`, `DiscoveredLayout`)
and `discover(project_root, package_name)`. Walks `src/` recursively
for the library (excluding the `src/bin/` subtree), enumerates
`src/main.cpp`, `src/bin/*.cpp`, `tests/*.cpp`, `examples/*.cpp` flat,
sorts results for deterministic output, and returns `LayoutNoTarget`
when neither a library nor any binary is present.
`tests/layout_discovery.cpp` covers 12 cases.