I tried 8efadd1 and it didn’t exhibit the problem. I suspect the issue comes from some of the plugin client reorganization stuff after this commit (cc @reuk).
Thanks, I see what’s going wrong. We’re currently trying to determine the cleanest solution, but should have something out shortly.
Tangentially-related: when I build your project locally with ClangCL, I get quite a lot of duplicate symbol warnings (ODR violations) when linking the test target. I think the problem is that the JUCE_DEPENDENCIES are linked separately to the plugin target and the test target. JUCE modules are interface targets, which means that they are built separately for each non-interface target that links against them. In turn, this means that the test binary contains two copied of the JUCE modules; one from the plugin shared-code target, and one linked directly to the test target.
To avoid the ODR violations, you could consider only linking JUCE_DEPENDENCIES to the shared-code target, then re-exporting the shared-code target’s preprocessor definitions and include directories. That way, when you add the shared-code target as a dependency of the test target, the test target will still inherit all of the JUCE flags and include directories.
Basically, our Tests target might need to specify different compile definitions, such as JUCE_MODAL_LOOPS_PERMITTED=1 or RUN_TESTS_IN_MODULES=1 — to accommodate this, it seems like there would need to be two compiled shared plugin targets?
We’re not quite sure how to approach that with the shared plugin target. I’ve been doing everything wrong (setting my modules to PUBLIC visibility) and that’s somehow been working for me with no linker warnings…
For some reason I wasn’t ever able to set additional definitions via target_compile_definitions for our Test target when going the “copy defs and dirs from the plugin target” route.
I’ve tried out @chrhaase’s suggestion of creating an INTERFACE target that houses the shared app code and definitions. The main juce shared plugin target as well as the Tests target then link to that.
Things seem happy now, but thought I’d share in case this is still unideal in some way. The other route I considered was just setting up a cmake flag/option, but that’s sort of bulkier/more manual…