Hi everyone! This is not specifically JUCE related, but I’d like to hear how you dealt with code organization vs. build granularity.
I currently use a single repository for all my plugin projects. With CMake and bash scripts I can build any plugin by specifying its name, format, configuration, and so on.
Different plugins share some common DSP classes that are currently built as a monolithic static library. The size of the DSP library is now grown to a point where I’d like to be more selective of what’s built when building a plugin.
I thought of a couple solutions to achieve this, but I can’t lend on any that I’d prefer yet:
-
Split the monolithic DSP library in smaller “thematic” submodules (eg. core, filters, delays, modulations). This seems to be a common solution to the problem, and it might work for core or base type libraries, but not for more complex groups. I’ll rarely need to build 5 different delays for a single plugin. What other “themes” might be a better approach?
-
Each plugin builds its own DSP static library. Only the needed files are built at the cost of no modular encapsulation, no flexibility and the consumer needing to know everything about the library structure. Ok for a small-size operation like mine, but still annoying to deal with at times.
-
Keep the monolithic static library and find something to do while building. Also thinking about IP protection: this isn’t optimal, is it? The linker should only include object files from static libraries that resolve symbols my plugin actually uses, but maybe some sneaky compiler optimization setting might inline something and unused symbols might end up in the final build? This way each plugin binary will include all my DSP. Not that there is anything worth spending time reverse engineering, but still.
How did you deal with this?
Thanks!
