summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2018-06-18 11:58:37 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-19 14:56:50 (GMT)
commit985d3a162ca7edcb26f35a06ca4754179335c7d3 (patch)
tree09959592f20c14526132310d8defd36ae57edcf1
parentbc5bcad45e1eaebbea0f1409f096d166cdb778d9 (diff)
downloadCMake-985d3a162ca7edcb26f35a06ca4754179335c7d3.zip
CMake-985d3a162ca7edcb26f35a06ca4754179335c7d3.tar.gz
CMake-985d3a162ca7edcb26f35a06ca4754179335c7d3.tar.bz2
Xcode: Use legacy build system
Closes: #18099
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx33
-rw-r--r--Source/cmGlobalXCodeGenerator.h4
2 files changed, 25 insertions, 12 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 58888c3..e9a08bf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3338,15 +3338,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();
@@ -3356,6 +3351,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)
{
@@ -3395,7 +3399,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";
@@ -3417,8 +3421,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();
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 0051c4a..ccef6e2 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -182,9 +182,11 @@ private:
std::vector<cmLocalGenerator*>& generators);
void OutputXCodeProject(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
+ bool IsGeneratingScheme(cmLocalGenerator* root) const;
// Write shared scheme files for all the native targets
void OutputXCodeSharedSchemes(const std::string& xcProjDir);
- void OutputXCodeWorkspaceSettings(const std::string& xcProjDir);
+ void OutputXCodeWorkspaceSettings(const std::string& xcProjDir,
+ cmLocalGenerator* root);
void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string& fullpath,