From 6a470bef5b0be271c80ff4252dfb922be698bcd1 Mon Sep 17 00:00:00 2001 From: attila Date: Fri, 6 Oct 2023 18:29:45 +0200 Subject: [PATCH] CMake: Add support for iokit sandbox exception --- docs/CMake API.md | 5 +++++ extras/Build/CMake/JUCEUtils.cmake | 2 ++ extras/Build/juceaide/Main.cpp | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/docs/CMake API.md b/docs/CMake API.md index f121bd6e4b..0f6df67e9c 100644 --- a/docs/CMake API.md +++ b/docs/CMake API.md @@ -454,6 +454,11 @@ attributes directly to these creation functions, rather than adding them later. - A set of space-separated paths that will be added to this target's entitlements plist for accessing read/write absolute paths if `APP_SANDBOX_ENABLED` is `TRUE`. +`APP_SANDBOX_EXCEPTION_IOKIT` +- A set of space-separated strings specifying IOUserClient subclasses to open or to set properties + on. These will be added to this target's entitlements plist if `APP_SANDBOX_ENABLED` is `TRUE`. + For more information see Apple's IOKit User Client Class Temporary Exception documentation. + `PLIST_TO_MERGE` - A string to insert into an app/plugin's Info.plist. diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index ffba13d13d..0beca97342 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -352,6 +352,7 @@ function(_juce_write_configure_time_info target) _juce_append_target_property(file_content APP_SANDBOX_FILE_ACCESS_HOME_RW ${target} JUCE_APP_SANDBOX_FILE_ACCESS_HOME_RW) _juce_append_target_property(file_content APP_SANDBOX_FILE_ACCESS_ABS_RO ${target} JUCE_APP_SANDBOX_FILE_ACCESS_ABS_RO) _juce_append_target_property(file_content APP_SANDBOX_FILE_ACCESS_ABS_RW ${target} JUCE_APP_SANDBOX_FILE_ACCESS_ABS_RW) + _juce_append_target_property(file_content APP_SANDBOX_EXCEPTION_IOKIT ${target} JUCE_APP_SANDBOX_EXCEPTION_IOKIT) _juce_append_target_property(file_content APP_GROUPS_ENABLED ${target} JUCE_APP_GROUPS_ENABLED) _juce_append_target_property(file_content APP_GROUP_IDS ${target} JUCE_APP_GROUP_IDS) _juce_append_target_property(file_content IS_PLUGIN ${target} JUCE_IS_PLUGIN) @@ -1892,6 +1893,7 @@ function(_juce_initialise_target target) APP_SANDBOX_FILE_ACCESS_HOME_RW APP_SANDBOX_FILE_ACCESS_ABS_RO APP_SANDBOX_FILE_ACCESS_ABS_RW + APP_SANDBOX_EXCEPTION_IOKIT DOCUMENT_EXTENSIONS AAX_CATEGORY IPHONE_SCREEN_ORIENTATIONS # iOS only diff --git a/extras/Build/juceaide/Main.cpp b/extras/Build/juceaide/Main.cpp index 401a7cad8b..916c695a83 100644 --- a/extras/Build/juceaide/Main.cpp +++ b/extras/Build/juceaide/Main.cpp @@ -368,6 +368,14 @@ juce::build_tools::EntitlementOptions parseEntitlementsOptions (const juce::File std::move (values) }); } + { + juce::StringArray values; + updateField ("APP_SANDBOX_EXCEPTION_IOKIT", values); + + if (! values.isEmpty()) + result.appSandboxExceptionIOKit = values; + } + result.type = type; return result;