mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-26 04:09:35 +03:00
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
18 lines
713 B
CMake
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()
|