Skip to content

Commit

Permalink
CMakeLists.txt: fix hang when >1 Camomile LV2 plugin is loaded (issue #…
Browse files Browse the repository at this point in the history
…286)

This issue was ultimately caused by an object buried in the JUCE code having
an inappropriate scope - GCC made the object a "unique global symbol", which
means there is only one instance across the current process.
When multiple plugins were loaded, they all shared this instance, but did
not share other relevant objects (from the JUCE code), causing havoc.
The fix is to ban GCC from marking symbols as "unique global".

Also set the C++ standard to be C++20 for the Camomile_LV2 meta-plugin, in
line with the other meta-plugins.
  • Loading branch information
hyperpenelope authored and pierreguillot committed May 19, 2023
1 parent 33a7eea commit 5d06ada
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ target_sources(CamomileFx PRIVATE ${CamomileSources} ${CamomilePdSources})

add_library(Camomile_LV2 SHARED ${CamomileLV2Sources})
target_link_libraries(Camomile_LV2 PRIVATE CamomileFx)
set_target_properties(Camomile_LV2 PROPERTIES PREFIX "")
set_target_properties(Camomile_LV2 PROPERTIES PREFIX "" CXX_STANDARD 20)

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
target_compile_options(Camomile_LV2 PRIVATE "-fno-gnu-unique")
endif()

set(CAMOMILE_COMPILE_DEFINITIONS
JUCE_APP_CONFIG_HEADER="${SOURCES_DIRECTORY}/PluginConfig.h"
Expand Down

0 comments on commit 5d06ada

Please sign in to comment.