Files
cmake/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile-build-check.cmake
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

18 lines
713 B
CMake

# Older Swift compilers may not set CMAKE_Swift_MODULE_TRIPLE
# Check that we built something before verifying the output
if(EXISTS "${RunCMake_TEST_BINARY_DIR}/no-swift-module-triple")
return()
endif()
if(NOT actual_stdout MATCHES
"swiftc(\\.exe)?\"? [^\n]* -c @CMakeFiles(/|\\\\)L\\.dir(/|\\\\)(Debug(/|\\\\))?L\\.o(bj)?\\.swift\\.rsp")
string(APPEND RunCMake_TEST_FAILED
"No Swift compile response-file command found for target L.\n")
endif()
if(NOT actual_stdout MATCHES
"swiftc(\\.exe)?\"? [^\n]* -emit-module @.*L\\.swiftmodule(/|\\\\)[-_a-zA-Z0-9]+\\.swiftmodule\\.rsp")
string(APPEND RunCMake_TEST_FAILED
"No Swift emit-module response-file command found for target L.\n")
endif()