diff options
-rw-r--r-- | Auxiliary/vim/syntax/cmake.vim | 2 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/XCODE_GENERATE_SCHEME.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst | 15 | ||||
-rw-r--r-- | Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst | 4 | ||||
-rw-r--r-- | Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst | 15 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 | ||||
-rw-r--r-- | Source/cmXCodeScheme.cxx | 12 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake | 20 |
11 files changed, 71 insertions, 7 deletions
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index e09ecf3..80bde99 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -426,6 +426,7 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_ARGUMENTS \ XCODE_SCHEME_DEBUG_AS_ROOT \ XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING + \ XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE @@ -1524,6 +1525,7 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER \ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN \ CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE \ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 3d74a11..5e18e10 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -432,6 +432,7 @@ Properties on Targets /prop_tgt/XCODE_SCHEME_ARGUMENTS /prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT /prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING + /prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE /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/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 9e867b8..628924f 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -262,6 +262,7 @@ Variables that Change Behavior /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_ENABLE_GPU_FRAME_CAPTURE_MODE /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE diff --git a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst index 06a3cf9..8f46d2f 100644 --- a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst +++ b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst @@ -38,6 +38,7 @@ The following target properties will be applied on the - :prop_tgt:`XCODE_SCHEME_ARGUMENTS` - :prop_tgt:`XCODE_SCHEME_DEBUG_AS_ROOT` - :prop_tgt:`XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING` +- :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` - :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` - :prop_tgt:`XCODE_SCHEME_EXECUTABLE` - :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY` diff --git a/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst new file mode 100644 index 0000000..6ffd694 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst @@ -0,0 +1,15 @@ +XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE +------------------------------------------ + +.. versionadded:: 3.23 + +Property value for ``GPU Frame Capture`` in the Options section of +the generated Xcode scheme. Example values are `Metal` and +`Disabled`. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` +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. diff --git a/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst b/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst new file mode 100644 index 0000000..a93e4e9 --- /dev/null +++ b/Help/release/dev/xcode-scheme-enable-gpu-frame-capture-mode.rst @@ -0,0 +1,4 @@ +xcode-scheme-enable-gpu-frame-capture-mode +------------------------------------------ + +* The Xcode project generation learned the variable `XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` to enable specifying the Xcode scheme option property `GPU Frame Capture`. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst new file mode 100644 index 0000000..3a3c847 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE.rst @@ -0,0 +1,15 @@ +CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE +------------------------------------------------ + +.. versionadded:: 3.23 + +Property value for ``GPU Frame Capture`` in the Options section of +the generated Xcode scheme. Example values are `Metal` and +`Disabled`. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE` +property on all targets. + +Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property +documentation to see all Xcode schema related properties. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 4f0dc60..efae691 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -400,6 +400,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("XCODE_SCHEME_ADDRESS_SANITIZER"); initProp("XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN"); initProp("XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING"); + initProp("XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE"); 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 e2c0f2d..2755d2f 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -9,6 +9,8 @@ #include <cmext/algorithm> +#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 diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake index c742f50..be44ecd 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake @@ -37,6 +37,12 @@ check_property("ZOMBIE_OBJECTS" "NSZombieEnabled") check_property("MALLOC_STACK" "MallocStackLogging") check_property("DYNAMIC_LINKER_API_USAGE" "DYLD_PRINT_APIS") check_property("DYNAMIC_LIBRARY_LOADS" "DYLD_PRINT_LIBRARIES") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_1" "enableGPUFrameCaptureMode=\"1\"") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_3" "enableGPUFrameCaptureMode=\"3\"") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED" "enableGPUFrameCaptureMode=\"3\"") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL" "enableGPUFrameCaptureMode=\"1\"") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED_MIXED_CASE" "enableGPUFrameCaptureMode=\"3\"") +check_property("ENABLE_GPU_FRAME_CAPTURE_MODE_METAL_MIXED_CASE" "enableGPUFrameCaptureMode=\"1\"") check_property("EXECUTABLE" "myExecutable") check_property("ARGUMENTS" [=["--foo"]=]) diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake index ce5c0c9..126a9fc 100644 --- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake @@ -26,16 +26,22 @@ create_scheme_for_variable(MALLOC_STACK) create_scheme_for_variable(DYNAMIC_LINKER_API_USAGE) create_scheme_for_variable(DYNAMIC_LIBRARY_LOADS) -function(create_scheme_for_property property value) +function(create_scheme_for_property scheme property value) set(XCODE_SCHEME_${property} ON) - add_executable(${property} main.cpp) - set_target_properties(${property} PROPERTIES XCODE_SCHEME_${property} "${value}") + add_executable(${scheme} main.cpp) + set_target_properties(${scheme} PROPERTIES XCODE_SCHEME_${property} "${value}") endfunction() -create_scheme_for_property(EXECUTABLE myExecutable) -create_scheme_for_property(ARGUMENTS "--foo;--bar=baz") -create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar") -create_scheme_for_property(WORKING_DIRECTORY "/working/dir") +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_1 ENABLE_GPU_FRAME_CAPTURE_MODE 1) +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_3 ENABLE_GPU_FRAME_CAPTURE_MODE 3) +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED ENABLE_GPU_FRAME_CAPTURE_MODE Disabled) +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_METAL ENABLE_GPU_FRAME_CAPTURE_MODE Metal) +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_DISABLED_MIXED_CASE ENABLE_GPU_FRAME_CAPTURE_MODE DISAbled) +create_scheme_for_property(ENABLE_GPU_FRAME_CAPTURE_MODE_METAL_MIXED_CASE ENABLE_GPU_FRAME_CAPTURE_MODE METal) +create_scheme_for_property(EXECUTABLE EXECUTABLE myExecutable) +create_scheme_for_property(ARGUMENTS ARGUMENTS "--foo;--bar=baz") +create_scheme_for_property(ENVIRONMENT ENVIRONMENT "FOO=foo;BAR=bar") +create_scheme_for_property(WORKING_DIRECTORY WORKING_DIRECTORY "/working/dir") add_executable(NoSchema main.cpp) set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF) |