Files
cmake/Tests/RunCMake/CompilerLauncher/C-launch-Build-check.cmake
Tyler Yankee 9d7da095fd Ninja: Restore cmcldeps command-line ordering
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
2026-07-14 12:32:21 -04:00

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()