-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Overview
The juce::FileChooser does not open in Logic Pro X, despite working as expected in the Standalone target. This was tested using a minimal example.
Steps to reproduce
- Clone the Pamplejuce repository
- Initialize submodules with
git submodule update --init --recursive - Add
JUCE_MODAL_LOOPS_PERMITTED=1totarget_compile_definitionsinCMakeLists.txt - Replace the
PluginEditor::inspectButtoncallback with:
// this chunk of code instantiates and opens the melatonin inspector
inspectButton.onClick = [&] {
DBG ("Button clicked");
auto fileChooser = std::make_unique<juce::FileChooser> (
"Select a file",
juce::File::getSpecialLocation (juce::File::userHomeDirectory),
"*.wav;*.mp3");
DBG ("File chooser created");
if (fileChooser->browseForFileToOpen())
{
DBG ("File selected");
}
};
- Build using the Xcode generator (
cmake -B build -G Xcode,open build/Pamplejuce.xcodeproj)
Solution
This is an issue with entitlements on MacOS. This can be fixed by adding the following options to the juce_add_plugin() call in CMakeLists.txt:
HARDENED_RUNTIME_ENABLED TRUE
HARDENED_RUNTIME_OPTIONS "com.apple.security.files.user-selected.read-write"
I thought that this would be helpful for anyone experiencing a similar issue - the JUCE documentation's coverage of entitlements is fairly limited, so maybe this is worth adding to Pamplejuce's CMakeLists.txt or the Pamplejuce documentation (if the 'out of the box' philosophy is to be maintained), as these details are abstracted away by the Projucer but not by the CMake API.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation