diff options
author | Brad King <brad.king@kitware.com> | 2022-10-21 14:37:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-24 16:37:50 (GMT) |
commit | 4451a1f54fd2c1ba6aed4c38c23cb45e09f6be1d (patch) | |
tree | 7779ae6da8b42129e0728c1066a219e848ab1dfb /Tests/CMakeLists.txt | |
parent | f78ad6223ae1b9495c63f5a466caa89dc50983b5 (diff) | |
download | CMake-4451a1f54fd2c1ba6aed4c38c23cb45e09f6be1d.zip CMake-4451a1f54fd2c1ba6aed4c38c23cb45e09f6be1d.tar.gz CMake-4451a1f54fd2c1ba6aed4c38c23cb45e09f6be1d.tar.bz2 |
Tests: Factor out a CMake_TEST_Swift variable for Swift test conditions
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 04db70b..6ca08d0 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -343,6 +343,11 @@ if(BUILD_TESTING) endif() endif() endif() + if(NOT DEFINED CMake_TEST_Swift) + if(CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT) + set(CMake_TEST_Swift 1) + endif() + endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. @@ -390,7 +395,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(MissingSourceFile MissingSourceFile) set_tests_properties(MissingSourceFile PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c") - if(CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT) + if(CMake_TEST_Swift) ADD_TEST_MACRO(SwiftOnly SwiftOnly) if(CMake_TEST_XCODE_SWIFT) ADD_TEST_MACRO(SwiftMix SwiftMix) |