summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-23 17:25:35 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-26 12:46:23 (GMT)
commitb35568f3f9f9b8f4b5b2a2e6f4d524540980c3ae (patch)
tree1fc4af01e44a75c99cf8da434e5fe58b7fcd07ff /Source/cmGlobalXCodeGenerator.cxx
parent49d50ad40719722236c7867bd69e7ab414224c49 (diff)
downloadCMake-b35568f3f9f9b8f4b5b2a2e6f4d524540980c3ae.zip
CMake-b35568f3f9f9b8f4b5b2a2e6f4d524540980c3ae.tar.gz
CMake-b35568f3f9f9b8f4b5b2a2e6f4d524540980c3ae.tar.bz2
Xcode: Add option to set Swift language version
Create a new CMAKE_Swift_LANGUAGE_VERSION variable to specify the SWIFT_VERSION attribute in a generated Xcode project. Ideally this would be a `<LANG>_STANDARD` property but since Swift support is very minimal we should reserve that property for more complete treatment later. Issue: #16326
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 42d97db..0d5de06 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2997,7 +2997,13 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->CreateString(this->GeneratorToolset));
}
if (this->GetLanguageEnabled("Swift")) {
- buildSettings->AddAttribute("SWIFT_VERSION", this->CreateString("2.3"));
+ std::string swiftVersion = "2.3";
+ if (const char* vers = this->CurrentMakefile->GetDefinition(
+ "CMAKE_Swift_LANGUAGE_VERSION")) {
+ swiftVersion = vers;
+ }
+ buildSettings->AddAttribute("SWIFT_VERSION",
+ this->CreateString(swiftVersion));
}
std::string symroot = root->GetCurrentBinaryDirectory();