diff --git a/Help/release/4.4.rst b/Help/release/4.4.rst index 9bee567403..4b90ceaf36 100644 --- a/Help/release/4.4.rst +++ b/Help/release/4.4.rst @@ -455,6 +455,6 @@ Changes made since CMake 4.4.0 include the following. .. 4.4.3 - * Swift policy :poilcy:`CMP0215`'s ``NEW`` behavior has been updated + * Swift policy :policy:`CMP0215`'s ``NEW`` behavior has been updated to require policies :policy:`CMP0157` and :policy:`CMP0195` to also be set to ``NEW``. diff --git a/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle-build-check.cmake b/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle-build-check.cmake index 5a0943e34f..b0777b9350 100644 --- a/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle-build-check.cmake +++ b/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle-build-check.cmake @@ -1,3 +1,9 @@ +# 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() + string( REGEX MATCHALL "swiftc(\\.exe)?\"? [^\n]* -emit-module-path [^\n]*L\\.swiftmodule[^ \n]*" diff --git a/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle.cmake b/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle.cmake index 076a974a82..f4662f19aa 100644 --- a/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle.cmake +++ b/Tests/RunCMake/Swift/EmitModuleSeparatelyDirectoryStyle.cmake @@ -10,6 +10,13 @@ endif() enable_language(Swift) +# Older Swift compilers may not set CMAKE_Swift_MODULE_TRIPLE +# Don't build anything if we can't do the nested module structure +if(NOT CMAKE_Swift_MODULE_TRIPLE) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/no-swift-module-triple" "") + return() +endif() + add_library(L STATIC L.swift) add_library(LClient STATIC LClient.swift) target_link_libraries(LClient PRIVATE L) diff --git a/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile-build-check.cmake b/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile-build-check.cmake index 2bf01963c7..a6a4e3db68 100644 --- a/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile-build-check.cmake +++ b/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile-build-check.cmake @@ -1,3 +1,9 @@ +# 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 diff --git a/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile.cmake b/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile.cmake index 772405b0c8..b9d900b6b5 100644 --- a/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile.cmake +++ b/Tests/RunCMake/Swift/EmitModuleSeparatelyResponseFile.cmake @@ -10,6 +10,13 @@ set(CMAKE_NINJA_FORCE_RESPONSE_FILE TRUE) enable_language(Swift) +# Older Swift compilers may not set CMAKE_Swift_MODULE_TRIPLE +# Don't build anything if we can't do the nested module structure +if(NOT CMAKE_Swift_MODULE_TRIPLE) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/no-swift-module-triple" "") + return() +endif() + add_library(L STATIC L.swift) add_library(LClient STATIC LClient.swift) target_link_libraries(LClient PRIVATE L)