From 40be48f8907e37e5bd1ce94d6b28f3bb4727db70 Mon Sep 17 00:00:00 2001 From: Harry Mallon Date: Mon, 11 Mar 2019 11:51:26 +0000 Subject: XCode: Add scheme option XCODE_SCHEME_DEBUG_AS_ROOT --- Auxiliary/vim/syntax/cmake.vim | 1 + Help/manual/cmake-properties.7.rst | 1 + Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst | 7 +++++++ Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst | 1 + Source/cmXCodeScheme.cxx | 5 +++++ 5 files changed, 15 insertions(+) create mode 100644 Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 7e029de..9610410 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -358,6 +358,7 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_ADDRESS_SANITIZER \ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN \ XCODE_SCHEME_ARGUMENTS + \ XCODE_SCHEME_DEBUG_AS_ROOT \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 16c3460..fce5584 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -353,6 +353,7 @@ Properties on Targets /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER /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_DISABLE_MAIN_THREAD_CHECKER /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE diff --git a/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst new file mode 100644 index 0000000..a53f836 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst @@ -0,0 +1,7 @@ +XCODE_SCHEME_DEBUG_AS_ROOT +-------------------------- + +Whether to debug the target as 'root'. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst index 7466784..707c6a0 100644 --- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst +++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst @@ -30,5 +30,6 @@ The following target properties will be applied on the "Info" and "Arguments" tab: - :prop_tgt:`XCODE_SCHEME_ARGUMENTS` +- :prop_tgt:`XCODE_SCHEME_DEBUG_AS_ROOT` - :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` - :prop_tgt:`XCODE_SCHEME_EXECUTABLE` diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index 1b16198..c33bb7e 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -177,6 +177,11 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, WriteLaunchActionAttribute(xout, "stopOnEveryMainThreadCheckerIssue", "XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP"); + if (this->Target->GetTarget()->GetPropertyAsBool( + "XCODE_SCHEME_DEBUG_AS_ROOT")) { + xout.Attribute("debugAsWhichUser", "root"); + } + // Diagnostics tab end if (IsExecutable(this->Target)) { -- cgit v0.12