mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
Since commit b6367f723b (Swift/Ninja: Emit modules separately from
compilation, 2026-04-10) the compile edge still appends
-emit-module -emit-module-path when emitModuleSeparately is active,
duplicating the emit-module edge. For targets with directory-style
module paths (CMP0195=NEW), this causes a file/directory conflict
that fails the build.
Guard -emit-module -emit-module-path on both the compile and
emit-module edges so they are not appended when the flags already
contain -emit-module-path (e.g. from the target's compile options).
Discovered building swift-syntax on Windows where the directory-style
path was overwritten by the flat path from the compile edge.
Issue: #27748
12 lines
448 B
CMake
12 lines
448 B
CMake
# When the target's flags already contain -emit-module-path, the emit-module
|
|
# edge should not append a second one that clobbers it.
|
|
# Match command lines that have two -emit-module-path flags on the same line.
|
|
string(
|
|
REGEX MATCHALL
|
|
"-emit-module-path [^\n]*-emit-module-path"
|
|
duplicate_flags "${actual_stdout}")
|
|
if(duplicate_flags)
|
|
string(APPEND RunCMake_TEST_FAILED
|
|
"Found command with duplicate -emit-module-path flags.\n")
|
|
endif()
|