@@ -1114,16 +1114,31 @@ for arch/env conditions and combinators.
11141114 ` build ` with ` cflags ` / ` cxxflags ` / ` ldflags ` / ` sources ` (mcpp 0.0.95+ —
11151115 conditional source globs, e.g. gating ` src/x86/**/*.asm ` behind
11161116 ` cfg(arch = "x86_64") ` ; ` ! ` -exclusion globs work here too), plus ` flags ` and
1117- ` include_dirs ` / ` include_dirs_after ` (mcpp 0.0.102+).
1117+ ` include_dirs ` / ` include_dirs_after ` (mcpp 0.0.102+), plus
1118+ ` private_include_dirs ` and ` std-module-flags ` (mcpp 2026.9.1.1+).
11181119- ** What ` build ` accepts is exactly the set of * additive build inputs*** — the
11191120 things that combine by appending and are consumed after the predicate is
1120- evaluated. ` linkage ` , ` target ` , and the profile knobs are deliberately not
1121- among them: they are * inputs to* target selection (conditioning ` target ` on
1122- a predicate evaluated against ` target ` is circular), or they need
1123- override-rather-than-append semantics.
1121+ evaluated, which is the member list of ` BuildInputs ` . ` linkage ` , ` target ` ,
1122+ and the profile knobs are deliberately not among them: they are * inputs to*
1123+ target selection (conditioning ` target ` on a predicate evaluated against
1124+ ` target ` is circular), or they need override-rather-than-append semantics.
1125+ A key outside the set is reported and ignored; the message lists the set it
1126+ checked against, so it cannot drift from the check.
11241127- ** Evaluated against the resolved target** — the ` --target ` triple for a cross
11251128 build, otherwise the host. So a native Linux build never even * downloads* a
11261129 ` [target.windows] ` dependency.
1130+ - ** Predicate keys** : ` os ` , ` arch ` , ` family ` , ` env ` — the triple's coordinates —
1131+ and, from mcpp 2026.9.1.1, the five target-side layer names ` compiler ` ,
1132+ ` compiler-runtime ` , ` kernel-abi ` , ` c-abi ` , ` c++-abi `
1133+ ([ 14 — The Target Side] ( 14-target-side.md ) ). Barewords ` linux ` / ` macos ` /
1134+ ` windows ` / ` unix ` are sugar for the matching ` os ` / ` family ` test. A key
1135+ outside this set is reported as a schema warning and the section does not
1136+ apply — it used to answer false in silence, which is indistinguishable from
1137+ a section that correctly did not match.
1138+ - ** A layer predicate cannot select dependencies.** A layer is resolved * from*
1139+ the dependency graph, so a dependency chosen by one would decide the answer
1140+ it is asking for. ` [target.'cfg(c-abi = "musl")'.dependencies] ` is reported
1141+ and ignored; the ` build ` inputs under the same predicate do apply.
11271142- ** Precedence** : an exact-triple table wins over a ` cfg ` /alias table; multiple
11281143 matching predicate tables have their flags concatenated. Conditional entries
11291144 are appended ** after** the unconditional ` [build] ` ones, so under GNU
@@ -1178,11 +1193,21 @@ The value is an xpkg reference or the empty string; a bare name is rejected when
11781193the manifest is parsed, because accepting it would install nothing and then fail
11791194much later naming a missing libc.
11801195
1181- A build program can ask which C library was resolved: ` mcpp::target_libc() `
1182- returns its package name and ` mcpp::target_libc_profile() ` the sub-directory for
1183- the target's ISA profile. Both are empty on the zero-libc tier. See
1196+ A build program can ask which C library ** payload** supplies the sysroot:
1197+ ` mcpp::target_libc() ` returns that package's name and
1198+ ` mcpp::target_libc_profile() ` the sub-directory for the target's ISA profile.
1199+ Both are empty on the zero-libc tier. See
11841200[ 13 — Bare-Metal and Freestanding Targets] ( 13-baremetal.md ) .
11851201
1202+ ⚠️ ** That is not the same question as "which C library did the target side
1203+ resolve to".** ` target_libc() ` names the payload mcpp installed, and that value
1204+ is an * input* to target-side resolution — a package in the dependency graph can
1205+ supply the C library instead, in which case the resolved ` c-abi ` is not what
1206+ this returns. To branch on the resolved layer, use a layer predicate:
1207+ ` [target.'cfg(c-abi = "musl")'.build] ` ([ 14 — The Target
1208+ Side] ( 14-target-side.md ) ). This paragraph said "which C library was resolved"
1209+ until 2026.9.1.1, which was the wrong one of the two.
1210+
11861211### 2.7.2 Bare metal (` os = none ` ) — freestanding targets
11871212
11881213` riscv64-none-elf ` and ` riscv32-none-elf ` are targets with no operating system
@@ -1304,6 +1329,13 @@ simd = { sources = ["src/simd/**"], flags = [
13041329 { glob = " src/simd/**/*.avx2.cpp" , cxxflags = [" -mavx2" ] } ] }
13051330```
13061331
1332+ - ** The table form accepts exactly** ` implies ` , ` forward ` , ` defines ` , ` sources ` ,
1333+ ` flags ` , ` requires ` , ` provides ` . Anything else is reported as a schema warning
1334+ and ignored (mcpp 2026.9.1.1+); ` deps ` is reported separately as reserved and
1335+ points at ` [feature-deps.<name>] ` . Before that release ` [features] ` was
1336+ the one structured section with no schema check at all, so a misplaced
1337+ ` include_dirs ` inside a feature built successfully with no diagnostic while
1338+ the identical mistake in ` [build] ` was reported.
13071339- ` defines ` are ** bare** macro names (no ` -D ` ); each desugars to ` -D<x> ` on the
13081340 package's own compile when the feature is active — exactly like `[ targets.* ]
13091341 defines`. They are restricted by convention to the package's ** own** namespaced
0 commit comments