diff options
author | Brad King <brad.king@kitware.com> | 2017-03-30 12:52:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-03-30 12:52:37 (GMT) |
commit | 7bb8b38cce0715c758aa3eb252a9dfc0bda1e2c7 (patch) | |
tree | 4b659ac90a5c28c96e58d936f394c644639f8e42 /Modules/CMakeDetermineCompilerId.cmake | |
parent | f6d802b5bcd201f48c7af47f27ec9e1dd0062171 (diff) | |
parent | 77139e320c8ec7f92e1298cc57fea7276faceb12 (diff) | |
download | CMake-7bb8b38cce0715c758aa3eb252a9dfc0bda1e2c7.zip CMake-7bb8b38cce0715c758aa3eb252a9dfc0bda1e2c7.tar.gz CMake-7bb8b38cce0715c758aa3eb252a9dfc0bda1e2c7.tar.bz2 |
Merge topic '16742-swift-3.0'
77139e32 Swift: Simplify mixed test case to make it version agnostic
c03141c0 Swift: Default to Swift 3.0 with Xcode 8.3 and later
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !638
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6fce8e2..1abbc01 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -298,7 +298,13 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_toolset "") endif() if("${lang}" STREQUAL "Swift") - set(id_lang_version "SWIFT_VERSION = 2.3;") + if(CMAKE_Swift_LANGUAGE_VERSION) + set(id_lang_version "SWIFT_VERSION = ${CMAKE_Swift_LANGUAGE_VERSION};") + elseif(XCODE_VERSION VERSION_GREATER_EQUAL 8.3) + set(id_lang_version "SWIFT_VERSION = 3.0;") + else() + set(id_lang_version "SWIFT_VERSION = 2.3;") + endif() else() set(id_lang_version "") endif() |