From e09a3eddb61e732728bd76d63fe8098f14c737c1 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Mon, 18 Oct 2021 06:35:11 +0100 Subject: Xcode: Support "GPU Frame Capture" scheme property Added XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE variable which sets the scheme property value for "GPU Frame Capture" in the Options section by setting the Xcode project variable "enableGPUFrameCaptureMode". Example values are "Metal" (1) and "Disabled" (3). XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE is initialized by the property CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE. Implements: #22700 --- Source/cmXCodeScheme.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Source/cmXCodeScheme.cxx') diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index e2c0f2daf6..2755d2fcf1 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -9,6 +9,8 @@ #include +#include "cmsys/String.h" + #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -148,6 +150,16 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, true); xout.Attribute("debugServiceExtension", "internal"); xout.Attribute("allowLocationSimulation", "YES"); + if (cmValue gpuFrameCaptureMode = this->Target->GetTarget()->GetProperty( + "XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE")) { + std::string value = *gpuFrameCaptureMode; + if (cmsysString_strcasecmp(value.c_str(), "Metal") == 0) { + value = "1"; + } else if (cmsysString_strcasecmp(value.c_str(), "Disabled") == 0) { + value = "3"; + } + xout.Attribute("enableGPUFrameCaptureMode", value); + } // Diagnostics tab begin -- cgit v1.2.1