You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
L1 of the manifest platform/environment design: a normal mcpp.toml can scope
[build] cflags/cxxflags/ldflags to a target predicate via
[target.'cfg(...)'.build], evaluated against the RESOLVED target (host triple
for a native build, the --target triple for a cross build) — so conditional
flags follow what the binary will run on, not the build host. Closes the gap
that forces consumers to generate per-OS [build] flags out-of-band (e.g.
mcpp-index's write_build_ldflags bash).
Mechanism (à la carte: the dependency graph stays applicative; this is a
declarative conditional over flags):
- manifest.cppm: [target.<predicate>.build] parsed DEFERRED into
Manifest::conditionalConfigs (parsing is target-agnostic).
- prepare.cppm: a recursive cfg() evaluator (cfgpred::) over
all/any/not + os/arch/family/env + bare windows/unix/linux/macos; the
context is derived from the resolved target triple (or host for native).
Matching predicates' flags merge into buildConfig right after --target
resolution, mirroring the [profile] merge.
- Cargo-style table syntax, vcpkg-trimmed token set; precedence and grammar per
.agents/docs/2026-06-29-manifest-environment-and-platform-design.md.
Conditional [dependencies] + lazy fetch are the documented fast-follow (Phase 1b).
Test: tests/e2e/85_target_cfg_build_flags.sh (cfg(linux)/cfg(unix) apply on a
Linux build; cfg(windows) does not; cfg(all(linux, not(arch="aarch64"))) applies
on x86_64 Linux). Regression: unit 27/0, e2e 70/73, self-host build at 0.0.74.
0 commit comments