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
This commit is contained in:
Brad King
2017-03-30 12:52:26 +00:00
committed by Kitware Robot
4 changed files with 15 additions and 9 deletions
+5 -1
View File
@@ -3117,10 +3117,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));