diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-04-23 17:05:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-17 14:09:35 (GMT) |
commit | a9180ccf9a9e845658ba455e2dbc2447b18d2654 (patch) | |
tree | e133ce290921b16c31b1cdc19186d269f525f5ab /Tests/CMakeLists.txt | |
parent | d745551fb6311f5db6e8133df63a7fc410e8a68b (diff) | |
download | CMake-a9180ccf9a9e845658ba455e2dbc2447b18d2654.zip CMake-a9180ccf9a9e845658ba455e2dbc2447b18d2654.tar.gz CMake-a9180ccf9a9e845658ba455e2dbc2447b18d2654.tar.bz2 |
Tests: add a check for the Swift compiler
This ensures that the tests only run when the Swift compiler is present.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d992986..a0f90b2 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -22,6 +22,7 @@ macro(ADD_TEST_MACRO NAME) endmacro() include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/CheckSwift.cmake) # Fake a user home directory to avoid polluting the real one. if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) @@ -365,11 +366,16 @@ if(BUILD_TESTING) ((NOT CMAKE_OSX_SDKPRODUCT STREQUAL "Mac OS X") OR (NOT CMAKE_OSX_SDKVERSION VERSION_LESS 10.10))) if(CMAKE_GENERATOR STREQUAL "Xcode") - ADD_TEST_MACRO(SwiftMix SwiftMix) - ADD_TEST_MACRO(SwiftOnly SwiftOnly) + set(CMake_TEST_XCODE_SWIFT 1) endif() endif() endif() + if(CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT) + ADD_TEST_MACRO(SwiftOnly SwiftOnly) + if(CMake_TEST_XCODE_SWIFT) + ADD_TEST_MACRO(SwiftMix SwiftMix) + endif() + endif() if(CMAKE_Fortran_COMPILER) ADD_TEST_MACRO(FortranOnly FortranOnly) endif() |