mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Restore the ordering before the refactoring in commit 0f20ba5b68
(Ninja: Swift: Extract helpers and reorder module flags, 2026-04-10,
v4.4.0-rc1~273^2~1) to ensure the correct precedence with launchers.
Add regression tests.
Fixes: #27931, #27934
22 lines
683 B
CMake
22 lines
683 B
CMake
if(RunCMake_GENERATOR STREQUAL "Ninja")
|
|
set(rules_ninja "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/rules.ninja")
|
|
set(build_ninja "${RunCMake_TEST_BINARY_DIR}/build.ninja")
|
|
|
|
file(READ "${rules_ninja}" ninja_content)
|
|
file(READ "${build_ninja}" build_ninja_content)
|
|
|
|
if(NOT ninja_content MATCHES "command = \"[^\"]*ctest(\.exe)?\" --launch")
|
|
set(RunCMake_TEST_FAILED
|
|
"Expected compile command to use ctest --launch: ${ninja_content}"
|
|
)
|
|
return()
|
|
endif()
|
|
|
|
if(NOT build_ninja_content MATCHES "LAUNCHER = [^\n]*USED_LAUNCHER=1")
|
|
set(RunCMake_TEST_FAILED
|
|
"Expected compile command to include the compiler launcher"
|
|
)
|
|
return()
|
|
endif()
|
|
endif()
|