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
Consolidated fixes from the three-lens pre-PR review (correctness /
cross-platform / architecture):
- #247 P0: escape_ninja_path emits generic (forward-slash) node names.
rspfile_content copies node names verbatim into a response file that
gcc/clang/GNU ar tokenize GNU-style, where backslash is an ESCAPE —
obj\cli.o would arrive as objcli.o and break every Windows
driver-style link. All Windows consumers accept forward slashes;
POSIX output is byte-identical.
- link/archive/shared rules: ONE link_rule emitter for both dialect
branches (useRsp = separateLinker || is_windows); msvc rule text
byte-identical to the previous hand-written stanzas.
- prepare.cppm: markDirectiveTail/foldDirectiveTailIntoPrivateBuild —
a single owner of 'which compile-visible channels a build.mcpp
directive lands in', shared by the dep loop and the root call site
(kills the #242 two-derivations shape the parallel tracks had
reintroduced). Link/source/fingerprint residues stay at the call
sites where they genuinely differ.
- BuildConfig::includeDirsAfter aligned to filesystem::path (was
string), deleting per-consumer conversions.
- local_include_flags derives the NASM degradation from cu.source
itself instead of a third parameter threaded by every caller.
- Windows shell fallback: cd /d (cmd.exe cd does not switch drives).
- docs: source= joins the cache-invalidation list; 0.0.100+ tags on
the new directives/env rows; NASM -I degradation documented (en+zh).
Copy file name to clipboardExpand all lines: docs/07-build-mcpp.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,9 @@ is ignored, so you can freely log diagnostics.
49
49
|`mcpp:link-search=<dir>`| add a library search dir (`-L`; relative dirs resolve against the project root) |
50
50
|`mcpp:cfg=<name>`| define `-D<name>` for both C and C++ |
51
51
|`mcpp:generated=<path>`| add a generated source (relative to the project root) to the build |
52
-
|`mcpp:source=<path>`| select a **pre-existing** source file into the build (absolute, or relative to the package root). Same downstream effect as `generated=`; use it for files the program *chose* (payload/vendored tree) rather than wrote — e.g. a per-target source selection over a large tarball |
53
-
|`mcpp:include-dir=<dir>`| add a **private** include directory (`-I`) for this package's own TUs (absolute, or relative to the package root; normalized). Replaces the `cxxflag=-I` + `cflag=-I` double emission |
54
-
|`mcpp:include-dir-after=<dir>`| like `include-dir`, but searched **after** the system directories (`-idirafter`) — for payload trees that shadow system headers |
52
+
|`mcpp:source=<path>`*(0.0.100+)*| select a **pre-existing** source file into the build (absolute, or relative to the package root). Same downstream effect as `generated=`; use it for files the program *chose* (payload/vendored tree) rather than wrote — e.g. a per-target source selection over a large tarball |
53
+
|`mcpp:include-dir=<dir>`*(0.0.100+)*| add a **private** include directory (`-I`) for this package's own TUs (absolute, or relative to the package root; normalized). Replaces the `cxxflag=-I` + `cflag=-I` double emission |
54
+
|`mcpp:include-dir-after=<dir>`*(0.0.100+)*| like `include-dir`, but searched **after** the system directories (`-idirafter`) — for payload trees that shadow system headers |
55
55
|`mcpp:rerun-if-changed=<path>`| re-run `build.mcpp` when this file changes |
56
56
|`mcpp:rerun-if-env-changed=<VAR>`| re-run `build.mcpp` when this env var changes |
57
57
@@ -111,16 +111,16 @@ The running program receives the build context as `MCPP_*` variables
111
111
| Variable | Typed reader | Value |
112
112
|---|---|---|
113
113
|`MCPP_TARGET`|`mcpp::target()`| resolved canonical triple (the `--target` triple under cross; the host triple natively) |
114
-
|`MCPP_TARGET_OS`|`mcpp::target_os()`| the target's OS segment (`linux`/`macos`/`windows`) — no need to hand-split `MCPP_TARGET`|
|`MCPP_TARGET_ENV`*(0.0.100+)*|`mcpp::target_env()`| the target's env segment (`gnu`/`musl`/`msvc`); empty string when the triple has none (macOS) |
117
117
|`MCPP_HOST`|`mcpp::host()`| the host triple |
118
118
|`MCPP_PROFILE`|`mcpp::profile()`| effective profile name (`dev`/`release`/…) |
119
119
|`MCPP_OUT_DIR`|`mcpp::out_dir()`| a writable scratch/output dir owned by mcpp |
120
120
|`MCPP_MANIFEST_DIR`|`mcpp::manifest_dir()`| the package root (= CWD) |
121
121
|`MCPP_FEATURE_<NAME>`|`mcpp::has_feature("name")`| set to `1` per active feature (same `<NAME>` sanitization as the `MCPP_FEATURE_` compile macro) |
122
122
|`MCPP_FEATURES`| — | comma-separated active feature list |
123
-
|`MCPP_DEP_<NAME>_DIR`|`mcpp::dep_dir("name")`| the resolved install dir of each declared dependency (canonical **and** namespace-stripped name spellings; same `<NAME>` sanitization as `MCPP_FEATURE_`). Received by dependencies' build.mcpp **and** the root project's (the root runs after dependency resolution) |
123
+
|`MCPP_DEP_<NAME>_DIR`|`mcpp::dep_dir("name")`| the resolved install dir of each declared dependency (canonical **and** namespace-stripped name spellings; same `<NAME>` sanitization as `MCPP_FEATURE_`). Received by dependencies' build.mcpp **and** the root project's (the root runs after dependency resolution, 0.0.100+) |
124
124
125
125
These values are folded into the re-run key **unconditionally** — changing the
126
126
target, profile, or feature set re-runs the program without any
@@ -147,7 +147,7 @@ directives and re-runs only when something it depends on changed:
147
147
- the toolchain,
148
148
- any file you declared with `rerun-if-changed`,
149
149
- any env var you declared with `rerun-if-env-changed`,
150
-
- (or a `generated` output went missing).
150
+
- (or a `generated` output / `source=` selection went missing).
151
151
152
152
So **declare your inputs**: if your program reads `config.h` or the `USE_FAST`
0 commit comments