CMake Standalone AUv3 Sporadic Target Failure

Hi JUCE community,

I’ve encountered a bug with CMake-based JUCE project generation for audio plugins that contain both a Standalone and AUv3 format target, resulting in sporadic omission of the Standalone target from the list of available targets once the project has been generated.

This issue can be easily reproduced on the latest version of JUCE 7 using the “AudioPlugin,” cmake example project. I’m currently using Xcode 14.2 as my IDE, when encountering this issue.

To reproduce this issue, specify Standalone and AUv3 as the desired FORMATS for our call to juce_add_plugin() within the JUCE/examples/CMake/AudioPlugin/CMakeLists.txt file, and generate the CMake project.

In my test, I generate the project using the rm -rf ./Builds && cmake . -GXcode -B./Builds command, also deleting the existing cached CMake files beforehand.

After each generation, check the available targets in Xcode, and notice that sporadically Standalone becomes unavailable. Please chime in to this thread if you’ve experienced this issue before.

juce_add_plugin(AudioPluginExample
    PLUGIN_MANUFACTURER_CODE Juce 
    PLUGIN_CODE Dem0
    FORMATS AUv3 Standalone
    PRODUCT_NAME "Audio Plugin Example") 

Screen Shot 2023-08-01 at 11.40.40 AM
Screen Shot 2023-08-01 at 11.42.41 AM

2 Likes

This has definitely happened to me many times. It’s incredibly annoying, and as far as I can tell, completely unpredictable. I haven’t heard a solid reason or solution either. I tend to choose different targets in Xcode and/or stop and restart Xcode…just flailing along…until it reappears.

Hopefully someone will respond to this thread with a solution.

1 Like

Thanks so much for chiming in and validating the findings. I’ve noticed it in the past, had written it off, and worked around it. Now it’s unfortunately blocking my CI pipeline, so hoping to find some solutions for this with the community’s help.

I ran into this issue as well. I believe that’s what solved it:

set(CMAKE_XCODE_GENERATE_SCHEME "YES" CACHE INTERNAL "")
1 Like

Thanks @eyalamir, this seems to resolve the issue I’m experiencing.