summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorPatriceJiang <397136899@qq.com>2022-08-18 03:53:52 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-30 14:26:48 (GMT)
commit39456c70e1792179b4db780771fe73082122ca5f (patch)
treecc8cab5b55b9f31e5f07e220153caf6dec15fa8e /Source
parent4034272ed8f4e4a19797bfd14dfe5268ad4b4324 (diff)
downloadCMake-39456c70e1792179b4db780771fe73082122ca5f.zip
CMake-39456c70e1792179b4db780771fe73082122ca5f.tar.gz
CMake-39456c70e1792179b4db780771fe73082122ca5f.tar.bz2
Xcode: Add settings to control a scheme's GPU Validation values
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx2
-rw-r--r--Source/cmXCodeScheme.cxx17
2 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index eafea05..8dc69fb 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -620,6 +620,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP");
initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER");
initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP");
+ initProp("XCODE_SCHEME_ENABLE_GPU_API_VALIDATION");
+ initProp("XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION");
initProp("XCODE_SCHEME_WORKING_DIRECTORY");
initProp("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER");
initProp("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP");
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index a62015f..1c609f3 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -198,6 +198,23 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
WriteLaunchActionAttribute(xout, "enableUBSanitizer",
"XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER");
+
+ if (cmValue value = this->Target->GetTarget()->GetProperty(
+ "XCODE_SCHEME_ENABLE_GPU_API_VALIDATION")) {
+ if (value.IsOff()) {
+ xout.Attribute("enableGPUValidationMode",
+ "1"); // unset means YES, "1" means NO
+ }
+ }
+
+ if (cmValue value = this->Target->GetTarget()->GetProperty(
+ "XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION")) {
+ if (value.IsOn()) {
+ xout.Attribute("enableGPUShaderValidationMode",
+ "2"); // unset means NO, "2" means YES
+ }
+ }
+
WriteLaunchActionAttribute(
xout, "stopOnEveryUBSanitizerIssue",
"XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP");