2 Commits
Author SHA1 Message Date
Evan Wilde e4a37fbf15 Tests/RunCMake/Swift: Add CMP0195 behavior checks
Adding checks to ensure that CMP0195 has the desired effect. If the
Swift compiler is too old and does not include the module triple in the
emitted target info, we won't set `CMAKE_Swift_MODULE_TRIPLE` and end up
with the flat directory structure. In this case, these tests won't have
the expected layout.

Issue: #28021
2026-08-13 10:18:16 -04:00
Roman Lavrov 899f1496f8 Swift/Ninja: Fix emit-module-path clobbering on separate emit-module edge
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
2026-04-27 18:57:47 -04:00