summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2019-10-01 18:53:06 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2019-10-01 21:02:35 (GMT)
commit67200c37b0a124534b3fa74bea9ed057d864ce1e (patch)
tree7278f031b74b0ac6328832c897a3975d8a4c181a /Source
parentc174e603be444be737fd332cfc45ae1e3fc812be (diff)
downloadCMake-67200c37b0a124534b3fa74bea9ed057d864ce1e.zip
CMake-67200c37b0a124534b3fa74bea9ed057d864ce1e.tar.gz
CMake-67200c37b0a124534b3fa74bea9ed057d864ce1e.tar.bz2
xcode: Add XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING property
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx1
-rw-r--r--Source/cmXCodeScheme.cxx23
-rw-r--r--Source/cmXCodeScheme.h5
3 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ae77d9e..7a2ecc2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -360,6 +360,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("XCODE_GENERATE_SCHEME");
initProp("XCODE_SCHEME_ADDRESS_SANITIZER");
initProp("XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN");
+ initProp("XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING");
initProp("XCODE_SCHEME_THREAD_SANITIZER");
initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP");
initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER");
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index a1c64ed..afc95f5 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -137,7 +137,9 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
xout.Attribute("launchStyle", "0");
xout.Attribute("useCustomWorkingDirectory", "NO");
xout.Attribute("ignoresPersistentStateOnLaunch", "NO");
- xout.Attribute("debugDocumentVersioning", "YES");
+ WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning",
+ "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING",
+ true);
xout.Attribute("debugServiceExtension", "internal");
xout.Attribute("allowLocationSimulation", "YES");
@@ -311,6 +313,21 @@ bool cmXCodeScheme::WriteLaunchActionAttribute(cmXMLWriter& xout,
return false;
}
+bool cmXCodeScheme::WriteLaunchActionBooleanAttribute(
+ cmXMLWriter& xout, const std::string& attrName, const std::string& varName,
+ bool defaultValue)
+{
+ auto property = Target->GetTarget()->GetProperty(varName);
+ bool isOn = (property == nullptr && defaultValue) || cmIsOn(property);
+
+ if (isOn) {
+ xout.Attribute(attrName.c_str(), "YES");
+ } else {
+ xout.Attribute(attrName.c_str(), "NO");
+ }
+ return isOn;
+}
+
bool cmXCodeScheme::WriteLaunchActionAdditionalOption(
cmXMLWriter& xout, const std::string& key, const std::string& value,
const std::string& varName)
@@ -339,7 +356,9 @@ void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES");
xout.Attribute("savedToolIdentifier", "");
xout.Attribute("useCustomWorkingDirectory", "NO");
- xout.Attribute("debugDocumentVersioning", "YES");
+ WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning",
+ "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING",
+ true);
xout.EndElement();
}
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index 1cc5324..dff5e35 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -46,6 +46,11 @@ private:
const std::string& attrName,
const std::string& varName);
+ bool WriteLaunchActionBooleanAttribute(cmXMLWriter& xout,
+ const std::string& attrName,
+ const std::string& varName,
+ bool defaultValue);
+
bool WriteLaunchActionAdditionalOption(cmXMLWriter& xout,
const std::string& attrName,
const std::string& value,