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 .swiftmodule output moved from the
compile edge to a separate emit-module edge. The link edge does not
depend on the emit-module output, so ninja never runs the emit-module
edge when no other target in the build imports the module (e.g.
install-only targets).
Store the declared .swiftmodule output path during Swift object
statement generation and add it as an implicit dependency of the link
edge.
Issue: #27748
13 lines
392 B
CMake
13 lines
392 B
CMake
cmake_policy(SET CMP0157 NEW)
|
|
cmake_policy(SET CMP0215 NEW)
|
|
|
|
if(NOT CMAKE_GENERATOR MATCHES "Ninja")
|
|
message(SEND_ERROR "this test must use a Ninja generator, found ${CMAKE_GENERATOR}")
|
|
endif()
|
|
|
|
enable_language(Swift)
|
|
|
|
# A standalone library with no dependent Swift targets. The link edge
|
|
# must still depend on the .swiftmodule so the emit-module edge runs.
|
|
add_library(L STATIC L.swift)
|