From dd9aa30669b745f1b55e754ab3b45a753ca39adf Mon Sep 17 00:00:00 2001 From: Penelope Clairmont Date: Fri, 21 Jan 2022 21:08:57 +0000 Subject: [PATCH] CMakeLists.txt: fix hang when >1 Camomile LV2 plugin is loaded (issue #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 the compiler 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. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a57ef157..1eac3ef5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,8 @@ 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) +target_compile_options(Camomile_LV2 PRIVATE "-fno-gnu-unique") set(CAMOMILE_COMPILE_DEFINITIONS JUCE_APP_CONFIG_HEADER="${SOURCES_DIRECTORY}/PluginConfig.h"