diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2015-09-05 21:39:27 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2015-09-05 21:39:27 (GMT) |
commit | d778a1c2ff56c425678bb9ec630c4fbd3d63bbbc (patch) | |
tree | 14baeb60e93315d4bdac47210e7269f74ddbf4a2 /Tests | |
parent | 4da60024adfb312883b93e5e3cacd928aa2e79ce (diff) | |
download | CMake-d778a1c2ff56c425678bb9ec630c4fbd3d63bbbc.zip CMake-d778a1c2ff56c425678bb9ec630c4fbd3d63bbbc.tar.gz CMake-d778a1c2ff56c425678bb9ec630c4fbd3d63bbbc.tar.bz2 |
Swift: Require Xcode 6.1 and for MacOS X at least SDK 10.10
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 801d7e8..2c6a42c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -213,6 +213,29 @@ if(BUILD_TESTING) set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}") endif() endif() + if(CMAKE_OSX_SYSROOT) + execute_process( + COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName + OUTPUT_VARIABLE _stdout + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE _stderr + RESULT_VARIABLE _failed + ) + if(NOT _failed) + set(CMAKE_OSX_SDKPRODUCT "${_stdout}") + endif() + + execute_process( + COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion + OUTPUT_VARIABLE _stdout + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE _stderr + RESULT_VARIABLE _failed + ) + if(NOT _failed) + set(CMAKE_OSX_SDKVERSION "${_stdout}") + endif() + endif() endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, @@ -258,10 +281,14 @@ 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_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1) - if(CMAKE_GENERATOR STREQUAL "Xcode") - ADD_TEST_MACRO(SwiftMix SwiftMix) - ADD_TEST_MACRO(SwiftOnly SwiftOnly) + if(CMake_TEST_XCODE_VERSION AND CMAKE_OSX_SDKVERSION AND CMAKE_OSX_SDKPRODUCT) + if((NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1) AND + ((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) + endif() endif() endif() if(CMAKE_Fortran_COMPILER) |