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
feat(build): a source glob may carry the accel it is for, and the build narrows to it
`[build] sources` accepts `{ glob = "...", accel = "..." }` entries. The glob
joins the plain list, so every reader keeps working; the constraint is
resolved in prepare after feature application. A constrained glob that
matches nothing is refused, naming it. Under a build that asks for no
accelerator the glob is excluded through the same `!` mechanism feature gates
use, which is how one project yields its CPU-only variant. Under a build
that targets something the constraint is not within, the build is refused
naming the glob and both sides (`accel-mismatch`). Device-kind files the
effective set matches reach the build program as MCPP_DEVICE_SOURCES; the
engine has no compile rule for them and the rule package turns each into an
action. Unit tests cover the table form and its refusals; e2e 606 measures
the four outcomes with a backend nothing knows.
Copy file name to clipboardExpand all lines: docs/07-build-mcpp.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -533,6 +533,7 @@ The running program receives the build context as `MCPP_*` variables
533
533
|`MCPP_HOST`|`mcpp::host()`| the host triple |
534
534
|`MCPP_PROFILE`|`mcpp::profile()`| effective profile name (`dev`/`release`/…) |
535
535
|`MCPP_ACCEL`*(2026.9.6+)*|`mcpp::accel()`| the device axis of this build, resolved — `--accel` / `--no-accel` over `[build] accel` — in the wire form `cuda12.9+{sm_89} ptx>=89`; empty when the build asks for no accelerator. A rule package derives its own flags (`-gencode`, `--offload-arch`) from it, so the architecture set is written once, in the manifest. The same value feeds the `cfg(accelerator = "…")` layer key |
536
+
|`MCPP_DEVICE_SOURCES`*(2026.9.6+)*|`mcpp::device_sources()`| the device-kind sources (`.cu`, `.hip`, …) the package's effective `sources` match, package-root-relative, one per line; empty when there are none. The engine compiles none of them — the rule package this program imports turns each into an `mcpp::action`. Already narrowed: a `{ glob, accel }` entry the build does not cover contributes nothing, so `--no-accel` yields an empty list |
536
537
|`MCPP_OUT_DIR`|`mcpp::out_dir()`| a writable scratch/output dir owned by mcpp |
537
538
|`MCPP_MANIFEST_DIR`|`mcpp::manifest_dir()`| the package root (= CWD) |
538
539
|`MCPP_FEATURE_<NAME>`|`mcpp::has_feature("name")`| set to `1` per active feature (same `<NAME>` sanitization as the `MCPP_FEATURE_` compile macro) |
0 commit comments