summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-02 11:50:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-10-02 11:51:06 (GMT)
commit0c5f78478ee6005f84c53ef7df3182fa208222f8 (patch)
treecf810fab1230107bf50434ac01f3ec8cbaaefce2 /Source
parent9649c91f830a6fad5c2f84b90f34af10c2edfa15 (diff)
parent67200c37b0a124534b3fa74bea9ed057d864ce1e (diff)
downloadCMake-0c5f78478ee6005f84c53ef7df3182fa208222f8.zip
CMake-0c5f78478ee6005f84c53ef7df3182fa208222f8.tar.gz
CMake-0c5f78478ee6005f84c53ef7df3182fa208222f8.tar.bz2
Merge topic 'xcode-debug-document-versioning'
67200c37b0 xcode: Add XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3876
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 62ead60..0d5b363 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -366,6 +366,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,