gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit bfe428a37ace4bf2157ac4e6be25bcf89042986d
parent fa0e75fc450119761a812e7ac3bb89e94a008677
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun,  9 Feb 2025 03:20:32 +0100

reduce number of juce modules that are compiled multiple times by stripping them from the plugins, linking our static lib instead

Diffstat:
Msource/juce.cmake | 35++++++++++++++++++++++++++++++++---
Msource/xtJucePlugin/CMakeLists.txt | 4++--
2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/source/juce.cmake b/source/juce.cmake @@ -60,8 +60,11 @@ set_property(TARGET ServerPlugins PROPERTY FOLDER CustomTargets) add_library(juce_plugin_modules STATIC) target_link_libraries(juce_plugin_modules PRIVATE + juce::juce_core + juce::juce_audio_basics juce::juce_audio_utils juce::juce_audio_devices + juce::juce_audio_processors juce::juce_cryptography ) @@ -74,14 +77,37 @@ target_compile_definitions(juce_plugin_modules PUBLIC JUCE_USE_MP3AUDIOFORMAT=0 JUCE_USE_FLAC=0 JUCE_USE_WINDOWS_MEDIA_FORMAT=0 + JUCE_MODULE_AVAILABLE_juce_core=1 + JUCE_MODULE_AVAILABLE_juce_audio_basics=1 + JUCE_MODULE_AVAILABLE_juce_audio_utils=1 + JUCE_MODULE_AVAILABLE_juce_audio_devices=1 + JUCE_MODULE_AVAILABLE_juce_audio_processors=1 + JUCE_MODULE_AVAILABLE_juce_cryptopgraphy=1 ) -if(ANDROID) - target_compile_definitions(juce_plugin_modules PUBLIC JUCE_MODULE_AVAILABLE_juce_audio_devices=1) -endif() +target_include_directories(juce_plugin_modules + INTERFACE + $<TARGET_PROPERTY:juce_plugin_modules,INCLUDE_DIRECTORIES>) _juce_fixup_module_source_groups() +# juce::juce_audio_plugin_client is the lib that every plugin links. However, this pulls in lots of juce modules that are +# all INTERFACE targets, causing all the sources to end up in every plugin we build. We remove this dependency as we already +# link them via our rebuilt static lib that we created above. This causes all juce modules to only show up in our static +# lib instead of every plugin + +macro(removeJuceDependencies targetName) + # Get the current link libraries before modifying + + get_target_property(pluginLibs ${targetName} LINK_LIBRARIES) + list(REMOVE_ITEM pluginLibs juce::juce_dsp juce::juce_audio_processors juce::juce_audio_formats juce::juce_audio_basics juce::juce_audio_plugin_client $<LINK_ONLY:juce::juce_audio_plugin_client>) + set_target_properties(${targetName} PROPERTIES LINK_LIBRARIES "${pluginLibs}") + + get_target_property(pluginLibs ${targetName} INTERFACE_LINK_LIBRARIES) + list(REMOVE_ITEM pluginLibs juce::juce_dsp juce::juce_audio_processors juce::juce_audio_formats juce::juce_audio_basics juce::juce_audio_plugin_client $<LINK_ONLY:juce::juce_audio_plugin_client>) + set_target_properties(${targetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${pluginLibs}") +endmacro() + macro(createJucePlugin targetName productName isSynth plugin4CC binaryDataProject synthLibProject) juce_add_plugin(${targetName} # VERSION ... # Set this if the plugin version is different to the project version @@ -111,6 +137,8 @@ macro(createJucePlugin targetName productName isSynth plugin4CC binaryDataProjec source_group("source" FILES ${SOURCES}) + removeJuceDependencies(${targetName}) + target_compile_definitions(${targetName} PUBLIC PluginName="${productName}" @@ -118,6 +146,7 @@ macro(createJucePlugin targetName productName isSynth plugin4CC binaryDataProjec PluginVersionMinor=${CMAKE_PROJECT_VERSION_MINOR} PluginVersionPatch=${CMAKE_PROJECT_VERSION_PATCH} Plugin4CC="${plugin4CC}" + JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 ) target_link_libraries(${targetName} diff --git a/source/xtJucePlugin/CMakeLists.txt b/source/xtJucePlugin/CMakeLists.txt @@ -49,8 +49,8 @@ juce_add_binary_data(xtJucePlugin_BinaryData SOURCES ${ASSETS} ${ASSETS_xtDefaul createJucePluginWithFX(xtJucePlugin "Xenia" "Txts" "Txtf" xtJucePlugin_BinaryData xtLib) -target_link_libraries(xtJucePlugin PUBLIC juce::juce_dsp) +target_link_libraries(xtJucePlugin PRIVATE juce::juce_dsp) if(${CMAKE_PROJECT_NAME}_BUILD_FX_PLUGIN) - target_link_libraries(xtJucePlugin_FX PUBLIC juce::juce_dsp) + target_link_libraries(xtJucePlugin_FX PRIVATE juce::juce_dsp) endif()