summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-03-28 14:04:02 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-28 20:06:29 (GMT)
commitc03141c04cededf6bf31d51627cd8b29c7668495 (patch)
treef88d4db6f9fc50eae5a25f64bb67f1e78eb1dc2a /Source/cmGlobalXCodeGenerator.cxx
parent1adbe223cd10ee133f5137da028ed86ddef7cc4d (diff)
downloadCMake-c03141c04cededf6bf31d51627cd8b29c7668495.zip
CMake-c03141c04cededf6bf31d51627cd8b29c7668495.tar.gz
CMake-c03141c04cededf6bf31d51627cd8b29c7668495.tar.bz2
Swift: Default to Swift 3.0 with Xcode 8.3 and later
Xcode 8.3 has dropped support for Swift 2.3 so that compiler and feature detection failed. Closes #16742
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 8627cf2..dd771b1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3075,10 +3075,14 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->CreateString(this->GeneratorToolset));
}
if (this->GetLanguageEnabled("Swift")) {
- std::string swiftVersion = "2.3";
+ std::string swiftVersion;
if (const char* vers = this->CurrentMakefile->GetDefinition(
"CMAKE_Swift_LANGUAGE_VERSION")) {
swiftVersion = vers;
+ } else if (this->XcodeVersion >= 83) {
+ swiftVersion = "3.0";
+ } else {
+ swiftVersion = "2.3";
}
buildSettings->AddAttribute("SWIFT_VERSION",
this->CreateString(swiftVersion));