File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,6 +219,16 @@ after expansion — so a glob may name exactly the directories it expands to. An
219219entry that is not among this package's ` include_dirs ` withholds nothing and is
220220reported as such rather than passing in silence.
221221
222+ ** On an older engine the key is ignored, never fatal.** Measured on 2026.8.26.2:
223+ in a dependency's manifest it is accepted silently, and in a root manifest it
224+ warns — ` [build] has unsupported key 'private_include_dirs' (ignored) ` — and the
225+ build continues. So a package may adopt the key without waiting for its
226+ consumers to upgrade; those on an older engine simply keep receiving the
227+ directory as they did before. The one place this does ** not** hold is a
228+ published ` xim ` descriptor's ` target_cfg ` block, where an unrecognised sub-key
229+ is a hard error that fails the whole manifest — do not put this key there until
230+ the index floor names an engine that knows it.
231+
222232` include_dirs_after ` (#249 ) lists header directories that are searched ** after**
223233the toolchain's system directories (emitted as ` -idirafter ` on GCC/Clang, as
224234trailing ` /I ` under the MSVC dialect, and as plain ` -I ` for NASM
Original file line number Diff line number Diff line change @@ -201,6 +201,13 @@ private_include_dirs = ["musl/src/include"]
201201所以一个 glob 可以恰好指名它展开出的那些目录。若某条目不在本包的 ` include_dirs `
202202里,它什么也没扣下,mcpp 会把这件事说出来而不是让它悄悄通过。
203203
204+ ** 旧引擎会忽略这个键,而不会因此失败。** 在 2026.8.26.2 上实测:出现在依赖的清单里
205+ 时被静默接受;出现在根清单里时给一条警告 —— `[ build] has unsupported key
206+ 'private_include_dirs' (ignored)` —— 构建照常继续。所以一个包可以先用上这个键,
207+ 不必等消费者升级;还在旧引擎上的消费者只是像以前一样继续收到那个目录。** 唯一不成立
208+ 的地方** 是已发布的 ` xim ` 描述符的 ` target_cfg ` 块:那里不认识的子键是硬错误,会让
209+ 整份清单加载失败 —— 在索引下限指向认识它的引擎之前,不要把这个键写进那里。
210+
204211` include_dirs_after ` (#249 )列出** 排在工具链系统目录之后** 搜索的头文件目录
205212(GCC/Clang 发射为 ` -idirafter ` ;MSVC 方言退化为排在末尾的 ` /I ` ,NASM 汇编
206213单元退化为普通 ` -I ` ——两者都没有对应 flag,也都没有需要保护的系统头搜索链)。当目录是解压后的源码 tarball 根目录、且其中的文件名会与标准头冲突时,
Original file line number Diff line number Diff line change @@ -1411,7 +1411,8 @@ synthesize_from_xpkg_lua(std::string_view luaContent,
14111411 return std::unexpected (ManifestError{
14121412 std::format (" unknown target_cfg key '{}' (expected "
14131413 " cflags/cxxflags/ldflags/sources/defines/"
1414- " flags/include_dirs/include_dirs_after)" , sub),
1414+ " flags/include_dirs/private_include_dirs/"
1415+ " include_dirs_after)" , sub),
14151416 m.sourcePath , 0 , 0 });
14161417 }
14171418 if (!cur.consume (' =' ) || !cur.consume (' {' )) {
You can’t perform that action at this time.
0 commit comments