This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  25e616862dac08aae7c4a3ad01839acfe7342ec7 (commit)
       via  96dece6dc11627d0e7b5588f63f2578b581cfb77 (commit)
      from  762a41fd19dff29de41009bfe7bcf69917e5ffb0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25e616862dac08aae7c4a3ad01839acfe7342ec7
commit 25e616862dac08aae7c4a3ad01839acfe7342ec7
Merge: 762a41f 96dece6
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Tue Feb 5 12:29:36 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Tue Feb 5 07:29:59 2019 -0500

    Merge topic 'swift-xcode-10.2'
    
    96dece6dc1 Xcode: Update default Swift language version for Xcode 10.2
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !2912


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96dece6dc11627d0e7b5588f63f2578b581cfb77
commit 96dece6dc11627d0e7b5588f63f2578b581cfb77
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Feb 4 12:05:08 2019 -0500
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Feb 4 13:26:10 2019 -0500

    Xcode: Update default Swift language version for Xcode 10.2
    
    Xcode 10.2 no longer supports Swift language versions before 4.0.
    
    Fixes: #18871

diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst 
b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
index 50121e2..b4a74eb 100644
--- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
+++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
@@ -1,5 +1,9 @@
 CMAKE_Swift_LANGUAGE_VERSION
 ----------------------------
 
-Set to the Swift language version number.  If not set, the legacy "2.3"
-version is assumed.
+Set to the Swift language version number.  If not set, the oldest legacy
+version known to be available in the host Xcode version is assumed:
+
+* Swift ``4.0`` for Xcode 10.2 and above.
+* Swift ``3.0`` for Xcode 8.3 and above.
+* Swift ``2.3`` for Xcode 8.2 and below.
diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index 2a0dbd3..cdbaea6 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -332,6 +332,8 @@ Id flags: ${testflags} 
${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
     if("${lang}" STREQUAL "Swift")
       if(CMAKE_Swift_LANGUAGE_VERSION)
         set(id_lang_version "SWIFT_VERSION = ${CMAKE_Swift_LANGUAGE_VERSION};")
+      elseif(XCODE_VERSION VERSION_GREATER_EQUAL 10.2)
+        set(id_lang_version "SWIFT_VERSION = 4.0;")
       elseif(XCODE_VERSION VERSION_GREATER_EQUAL 8.3)
         set(id_lang_version "SWIFT_VERSION = 3.0;")
       else()
diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index b428ae1..16f8a0e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3142,6 +3142,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
     if (const char* vers = this->CurrentMakefile->GetDefinition(
           "CMAKE_Swift_LANGUAGE_VERSION")) {
       swiftVersion = vers;
+    } else if (this->XcodeVersion >= 102) {
+      swiftVersion = "4.0";
     } else if (this->XcodeVersion >= 83) {
       swiftVersion = "3.0";
     } else {
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index cf4463c..e5f8588 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -1,7 +1,9 @@
 cmake_minimum_required(VERSION 3.3)
 project(SwiftOnly Swift)
 
-if(NOT XCODE_VERSION VERSION_LESS 8.0)
+if(NOT XCODE_VERSION VERSION_LESS 10.2)
+  set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
+elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
   set(CMAKE_Swift_LANGUAGE_VERSION 3.0)
 endif()
 

-----------------------------------------------------------------------

Summary of changes:
 Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst | 8 ++++++--
 Modules/CMakeDetermineCompilerId.cmake         | 2 ++
 Source/cmGlobalXCodeGenerator.cxx              | 2 ++
 Tests/SwiftOnly/CMakeLists.txt                 | 4 +++-
 4 files changed, 13 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to