From 27a4a14b7e82f7735b693b712d8f9b22eba9ffef 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 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. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a57ef157..bddb1b0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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"