AU built on Catalina does not load in Mojave

If an AU plugin is compiled on Catalina, what setting is required to make it run on Mojave? A plugin project AU we’re working on only works in Mojave if it is compiled on Mojave.

When running the Catalina-built AU on a Mojave machine, Ableton complains with “This Audio Unit plugin could not be opened”.
And auval fails with FATAL ERROR: didn't find the component

I tried setting the deployment version flag in CMake but did not fix the issue:

set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X deployment version" FORCE)

The project is being built with CMake using JUCE 6.0.8.

Did you clear the build directory after adding the deployment target before re-running CMake? I noticed that the setting won’t be applied otherwise, which is related to the CACHE thing afaik (I have yet to look up the in depth meaning of that myself)

Thanks, I’ll check that - the problem builds originally came from a build server, which starts each build from scratch so there should be no leftover cache from the previous build.

I recommend checking where you’re calling set(CMAKE_OSX_DEPLOYMENT_TARGET ...). The docs say this:

The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags.

Normally, I’d pass this on the commandline when running the configure step, and would avoid putting it in the CMakeLists altogether. This way, it’s guaranteed to be set at the necessary point in the configuration.

Thanks. It is being called before project. I’ll try to set it in on the command line in the configure step.