I’ve built a JUCE audio plugin with CMake, with this flag:
set(CMAKE_OSX_DEPLOYMENT_TARGET “10.14” CACHE STRING “Minimum OS X deployment target” FORCE)
Because I would like my plugin to run on older macOS version down to the 10.14. I’ve checked with otool and it seems ok:
minos 10.14
sdk 14.0
But on macOS 10.14 my plugin crashes at startup because of a missing symbol: NSWorkspace.OpenConfiguration
I suppose that this symbol is used inside the JUCE library. The official Apple documentation says that this object has been introduced with macOS 10.15 .
How can I make sure that my executable will run on all macOS version from 10.14 to 14?
Uhm actually I’m using the CMake extension for VSCode to build, that of course use the XCode SDK (with Clang 15.0.0). So basically I’m not directly writing the build command in the command line.
Something like that, but you need the flag to be passed to the linker rather than to the compiler. You can do that with CMAKE_EXE_LINKER_FLAGS and/or target_link_options.
Would these flags be set automatically by the latest Projucer when targeting 10.13 as the minimum Mac OS (I am guessing that’s a no)?
I am a little bit surprised that XCode would not already use the correct options (or provide a warning) if it sees the OS targeted is requiring that, but what really seems to be the case is that the out of the box (i.e. no special other tweaks) min supported OS for XCcode 15 is actually OS 12.0 according to the release notes and not 10.13.