diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2017-11-04 14:27:48 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2017-12-22 20:56:53 (GMT) |
commit | 4017bf40de512e977d59c12f4e3f6c91f5dd953d (patch) | |
tree | 4ef1e4b8d4b325e5a746273c1d036d29215a82b4 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 8f4663ffb265b6216cc9da9019e6169e27f0d8ec (diff) | |
download | CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.zip CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.tar.gz CMake-4017bf40de512e977d59c12f4e3f6c91f5dd953d.tar.bz2 |
Darwin: Emit deployment target that matches the SDK
Closes: #17431
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f392589..5c6a846 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2992,7 +2992,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( buildSettings->AddAttribute("ARCHS", this->CreateString(archs)); } if (deploymentTarget && *deploymentTarget) { - buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET", + buildSettings->AddAttribute(GetDeploymentPlatform(root->GetMakefile()), this->CreateString(deploymentTarget)); } if (!this->GeneratorToolset.empty()) { @@ -3627,3 +3627,24 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory( dir += "/"; gt->ObjectDirectory = dir; } + +std::string cmGlobalXCodeGenerator::GetDeploymentPlatform(const cmMakefile* mf) +{ + switch (mf->GetAppleSDKType()) { + case cmMakefile::AppleSDK::AppleTVOS: + case cmMakefile::AppleSDK::AppleTVSimulator: + return "TVOS_DEPLOYMENT_TARGET"; + + case cmMakefile::AppleSDK::IPhoneOS: + case cmMakefile::AppleSDK::IPhoneSimulator: + return "IPHONEOS_DEPLOYMENT_TARGET"; + + case cmMakefile::AppleSDK::WatchOS: + case cmMakefile::AppleSDK::WatchSimulator: + return "WATCHOS_DEPLOYMENT_TARGET"; + + case cmMakefile::AppleSDK::MacOS: + default: + return "MACOSX_DEPLOYMENT_TARGET"; + } +} |