Common static library for multi-plugin project


I have a multi-plugin CMake project with the following plugins type support inside: AU, VST, VST3, AAX.
The building process for all plugins get too much time because each plugin type needs to call the juce_add_plugin and create its own static library again and again.
But actually, all plugins use the same JUCE library.

Is it possible to optimize JUCE building process and make one static library for JUCE library and then create an independent DLL with the needed entry point for each type of plugin?


Sorry if I’ve misunderstood but it sounds like you’re saying you have a separate project/target for each plugin type? IE you’re doing something like this in your CMake:

juce_add_plugin(MyPluginAAX FORMATS AAX)
juce_add_plugin(MyPluginVST3 FORMATS VST3)

You should just have one project that has multiple types and then JUCE will do the work of reusing the shared code for you:

juce_add_plugin(MyPlugin FORMATS AAX VST3)
1 Like

Yes, currently it like mentioned! Thanks, I will try and reply soon

    set(BUNDLE_ID "com.test.aax")
    set(BUNDLE_ID "")
    set(BUNDLE_ID "com.test.vst")

@ImJimmi How to setup the correct bundle_id in case of multiple types in the juce_add_plugin as mentioned?

What’s the use case for this? I don’t specify bundle IDs at all for my plugins

I assume for MacOS bundle.

Do you need a separate bundle id for each plugin type? Most JUCE plugins don’t do this.

Current I have, but I’m not for sure if this needed or it’s legacy stuff

It’s not legacy, but it’s also probably not needed. I’d recommend adding all plugin formats in one go, as suggested earlier:

juce_add_plugin(MyPlugin FORMATS AAX AU VST VST3)

This will automatically create a single static library target containing the bulk of the plugin code, which is then used by each of the individual plugins.

Mac crashdump contains host name and host bundle id (that will be DAW in case of plugins)…
stack frame contains bundle identifier of the item where the frame is located in… and in the case where bundle id is the same for everything it will be the same for each plugin type making it harder to deduce plugin type if the information is not provided by client…
I’m not really sure that one bundle is good enough

I think the crash dump will normally show the location of the loaded bundle. e.g. if you have a crash in com.example.myplugin then you should be able to search the log for this bundle identifier. Later in the log, there should be a line showing that the bundle was loaded from /Library/Audio/Plug-Ins/VST, /Library/Audio/Plug-Ins/Components etc, allowing you to determine the plugin type.

This approach won’t work if a user has multiple types of plugin all loaded into the same process simulaneously, but this is reasonably unlikely in practice.

1 Like