If you want to build both plugin targets and a test target, unfortunately the additional abstraction of the INTERFACE SharedCode target is needed (as of Nov 2023). If you aren’t running tests, shame on you, but hey, then you can edit the CMake and get rid of it 🙂

The summary: JUCE modules build separately for each target. You need to link against them with PRIVATE visibility. But both JUCE’s internal plugin shared code target (which powers the formats like AU, VST, etc) and Pamplejuce’s Tests target need to link against the same JUCE modules.

This becomes a problem when you link Tests to YourPlugin target, as it causes ODL issues and confuses your IDE. Additionally, it is hard/impossible to set different compile definitions for the Tests target vs. plugin targets (for example, you’ll probably need to enable the deprecated modal loops, guard macros for running tests, etc).

I spoke with Reuben at JUCE a bit about this here and there’s a Pamplejuce issue with background here.


Leave a Reply

Your email address will not be published. Required fields are marked *