diff options
author | Brad King <brad.king@kitware.com> | 2018-06-20 13:42:16 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-06-20 13:42:25 (GMT) |
commit | e11f660ae1b31f730212af43e1094f8dc3d42ef8 (patch) | |
tree | c2640181f8d0361b6682fb004d5fa6b8d4d8ac19 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 20f042374730b2e1ee756c3b5939b63d6769cac3 (diff) | |
parent | ca6920689300249f67c4914cef521963c72a0d3f (diff) | |
download | CMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.zip CMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.tar.gz CMake-e11f660ae1b31f730212af43e1094f8dc3d42ef8.tar.bz2 |
Merge topic 'xcode-10-legacy-build-system'
ca69206893 Tests: Do not use i386 architecture with Xcode 10 and above
71fa78ff7a Tests: Teach RunCMake to ignore Xcode missing file type warnings
057ecb8f6f C++ feature checks: Ignore Xcode warnings
985d3a162c Xcode: Use legacy build system
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2151
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index dae4592..02297d5 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3342,15 +3342,10 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( } this->WriteXCodePBXProj(fout, root, generators); - // Since the lowest available Xcode version for testing was 6.4, - // I'm setting this as a limit then - if (this->XcodeVersion >= 64) { - if (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || - root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")) { - this->OutputXCodeSharedSchemes(xcodeDir); - this->OutputXCodeWorkspaceSettings(xcodeDir); - } + if (this->IsGeneratingScheme(root)) { + this->OutputXCodeSharedSchemes(xcodeDir); } + this->OutputXCodeWorkspaceSettings(xcodeDir, root); this->ClearXCodeObjects(); @@ -3360,6 +3355,15 @@ void cmGlobalXCodeGenerator::OutputXCodeProject( root->GetBinaryDirectory()); } +bool cmGlobalXCodeGenerator::IsGeneratingScheme(cmLocalGenerator* root) const +{ + // Since the lowest available Xcode version for testing was 6.4, + // I'm setting this as a limit then + return this->XcodeVersion >= 64 && + (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() || + root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_SCHEME")); +} + void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( const std::string& xcProjDir) { @@ -3399,7 +3403,7 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes( } void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( - const std::string& xcProjDir) + const std::string& xcProjDir, cmLocalGenerator* root) { std::string xcodeSharedDataDir = xcProjDir; xcodeSharedDataDir += "/project.xcworkspace/xcshareddata"; @@ -3421,8 +3425,15 @@ void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings( xout.StartElement("plist"); xout.Attribute("version", "1.0"); xout.StartElement("dict"); - xout.Element("key", "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded"); - xout.Element("false"); + if (this->XcodeVersion >= 100) { + xout.Element("key", "BuildSystemType"); + xout.Element("string", "Original"); + } + if (this->IsGeneratingScheme(root)) { + xout.Element("key", + "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded"); + xout.Element("false"); + } xout.EndElement(); // dict xout.EndElement(); // plist xout.EndDocument(); |