The main reason to build all modules together is to ensure a consistent set of JUCE_MODULE_AVAILABLE_ definitions. One possiblity might be to exclude the plugin_client module from the staticlib and to manually define JUCE_MODULE_AVAILABLE_juce_audio_plugin_client=1 on the staticlib.
Sorry, I wasn’t clear. I meant linking the juce modules to the plugin target, in the same way as the plugin demo from the repo. JUCE modules are CMake INTERFACE targets, so they will be built into each target that links against them.
juce_add_plugin(AudioPluginExample ...)
target_link_libraries(AudioPluginExample
PRIVATE
juce::juce_audio_utils
# other modules here
)
