Commit 67200c37 authored by Gregor Jasny's avatar Gregor Jasny

xcode: Add XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING property

parent c174e603
......@@ -375,6 +375,7 @@ Properties on Targets
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
/prop_tgt/XCODE_SCHEME_ARGUMENTS
/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT
/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
......
......@@ -234,6 +234,7 @@ Variables that Change Behavior
/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
......
......@@ -31,9 +31,10 @@ at target creation time.
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
The following target properties will be applied on the
"Info" and "Arguments" tab:
"Info", "Arguments", and "Options" tab:
- :prop_tgt:`XCODE_SCHEME_ARGUMENTS`
- :prop_tgt:`XCODE_SCHEME_DEBUG_AS_ROOT`
- :prop_tgt:`XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING`
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
--------------------------------------
Whether to enable
``Allow debugging when using document Versions Browser``
in the Options section of the generated Xcode scheme.
This property is initialized by the value of the variable
:variable:`CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING`
if it is set when a target is created.
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
documentation to see all Xcode schema related properties.
xcode-debug-document-versioning
-------------------------------
* The Xcode generator learnt to set the value of the
``Allow debugging when using document Versions Browser`` schema
option with the :prop_tgt:`XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING`
target property.
CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
--------------------------------------------
Whether to enable
``Allow debugging when using document Versions Browser``
in the Options section of the generated Xcode scheme.
This variable initializes the
:prop_tgt:`XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING`
property on all targets.
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
documentation to see all Xcode schema related properties.
......@@ -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");
......
......@@ -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();
}
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment