Xcode: Do not autocreate schemes

This commit is contained in:
Gregor Jasny
2017-02-24 16:19:14 +01:00
parent 6a54d28e44
commit 5995082101
2 changed files with 32 additions and 0 deletions

View File

@@ -3345,6 +3345,7 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
"XCODE_GENERATE_SCHEME") &&
this->XcodeVersion >= 70) {
this->OutputXCodeSharedSchemes(xcodeDir, root);
this->OutputXCodeWorkspaceSettings(xcodeDir);
}
this->ClearXCodeObjects();
@@ -3373,6 +3374,36 @@ void cmGlobalXCodeGenerator::OutputXCodeSharedSchemes(
}
}
void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
const std::string& xcProjDir)
{
std::string xcodeSharedDataDir = xcProjDir;
xcodeSharedDataDir += "/project.xcworkspace/xcshareddata";
cmSystemTools::MakeDirectory(xcodeSharedDataDir);
std::string workspaceSettingsFile = xcodeSharedDataDir;
workspaceSettingsFile += "/WorkspaceSettings.xcsettings";
cmGeneratedFileStream fout(workspaceSettingsFile.c_str());
fout.SetCopyIfDifferent(true);
if (!fout) {
return;
}
cmXMLWriter xout(fout);
xout.StartDocument();
xout.Doctype("plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\""
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"");
xout.StartElement("plist");
xout.Attribute("version", "1.0");
xout.StartElement("dict");
xout.Element("key", "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded");
xout.Element("false");
xout.EndElement(); // dict
xout.EndElement(); // plist
xout.EndDocument();
}
void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
cmLocalGenerator*,
std::vector<cmLocalGenerator*>&)

View File

@@ -168,6 +168,7 @@ private:
// Write shared scheme files for all the native targets
void OutputXCodeSharedSchemes(const std::string& xcProjDir,
cmLocalGenerator* root);
void OutputXCodeWorkspaceSettings(const std::string& xcProjDir);
void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
cmXCodeObject* CreateXCodeFileReferenceFromPath(const std::string& fullpath,