From 06a6619cb87822e40753987a3ad10878b9b447f1 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 20 Oct 2020 16:49:26 +0100 Subject: [PATCH 1/4] CMake: Fix CMake bug which caused incorrect plugin manufacturer code to be generated Please see the breaking changes doc for details. --- BREAKING-CHANGES.txt | 31 ++++++++++++++++++++++++++++++ docs/CMake API.md | 7 +++++++ extras/Build/CMake/JUCEUtils.cmake | 9 ++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index 64a3fb19dc..0d93774397 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -1,6 +1,37 @@ JUCE breaking changes ===================== +Master +====== + +Change +------ +A typo in the JUCEUtils CMake script that caused the wrong manufacturer code to +be set in the compile definitions for a plugin was fixed. + +Possible Issues +--------------- +The manufacturer code for plugins built under CMake with this version of JUCE +will differ from the manufacturer code that was generated previously. + +Workaround +---------- +If you have released plugins that used the old, incorrect manufacturer code and +wish to continue using this code for backwards compatibility, add the following +to your `juce_add_plugin` call: + + USE_LEGACY_COMPATIBILITY_PLUGIN_CODE TRUE + +In most cases, this should not be necessary, and we recommend using the fixed +behaviour. + +Rationale +--------- +This change ensures that the manufacturer codes used by CMake projects match +the codes that would be generated by the Projucer, improving compatibility +when transitioning from the Projucer to CMake. + + Version 6.0.2 ============= diff --git a/docs/CMake API.md b/docs/CMake API.md index cfcc469a54..19ff42e469 100644 --- a/docs/CMake API.md +++ b/docs/CMake API.md @@ -495,6 +495,13 @@ attributes directly to these creation functions, rather than adding them later. hosting plugins. Using this parameter should be preferred over using `target_compile_definitions` to manually set the `JUCE_PLUGINHOST_AU` preprocessor definition. +- `USE_LEGACY_COMPATIBILITY_PLUGIN_CODE` + - May be either TRUE or FALSE (defaults to FALSE). If TRUE, will override the value of the + preprocessor definition "JucePlugin_ManufacturerCode" with the hex equivalent of "proj". This + option exists to maintain compatiblity with a previous, buggy version of JUCE's CMake support + which mishandled the manufacturer code property. Most projects should leave this option set to + its default value. + - `COPY_PLUGIN_AFTER_BUILD` - Whether or not to install the plugin to the current system after building. False by default. If you want all of the plugins in a subdirectory to be installed automatically after building, diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index 49437e0cd8..233c081892 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -1527,9 +1527,15 @@ function(_juce_configure_plugin_targets target) get_target_property(project_version_string ${target} JUCE_VERSION) _juce_version_code(${project_version_string} project_version_hex) - get_target_property(project_manufacturer_code ${target} JUCE_PLUGIN_MANUFACTURERER_CODE) + get_target_property(project_manufacturer_code ${target} JUCE_PLUGIN_MANUFACTURER_CODE) get_target_property(project_plugin_code ${target} JUCE_PLUGIN_CODE) + get_target_property(use_legacy_compatibility_plugin_code ${target} JUCE_USE_LEGACY_COMPATIBILITY_PLUGIN_CODE) + + if(use_legacy_compatibility_plugin_code) + set(project_manufacturer_code "project_manufacturer_code-NOTFOUND") + endif() + _juce_to_char_literal(${project_manufacturer_code} project_manufacturer_code) _juce_to_char_literal(${project_plugin_code} project_plugin_code) @@ -1897,6 +1903,7 @@ function(_juce_initialise_target target) AU_SANDBOX_SAFE AAX_CATEGORY PLUGINHOST_AU # Set this true if you want to host AU plugins + USE_LEGACY_COMPATIBILITY_PLUGIN_CODE VST_COPY_DIR VST3_COPY_DIR From d1bb4d61f03b252ce95712c0ba33580c3fd14f65 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Sat, 31 Oct 2020 08:29:25 +0000 Subject: [PATCH 2/4] AAX: Fixes an Xcode compiler warning Ignore tautological-overlap-compare in the AAX headers --- modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 87e639a6db..95a0913245 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -43,7 +43,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", "-Wpragma-pack", "-Wzero-as-null-pointer-constant", "-Winconsistent-missing-destructor-override", - "-Wfour-char-constants") + "-Wfour-char-constants", + "-Wtautological-overlap-compare") #include From 761eb566f5f574394811ebb84ecf60a1b2944b5b Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Tue, 3 Nov 2020 14:01:49 +0000 Subject: [PATCH 3/4] Fixed some compiler warnings --- modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index b8a0905ef3..f9b8bed8ab 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -1210,8 +1210,8 @@ public: auto scale = Desktop::getInstance().getGlobalScaleFactor(); X11Symbols::getInstance()->xResizeWindow (display, (Window) getWindowHandle(), - static_cast (roundToInt (pos.getWidth() * scale)), - static_cast (roundToInt (pos.getHeight() * scale))); + static_cast (roundToInt ((float) pos.getWidth() * scale)), + static_cast (roundToInt ((float) pos.getHeight() * scale))); #endif #if JUCE_MAC From df3b49fbd35655ed2530e77e005034d87987c765 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 26 Oct 2020 19:18:27 +0000 Subject: [PATCH 4/4] VST2: Fix conversion warnings on Linux --- .../format_types/juce_VSTPluginFormat.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 5341351771..871a69bb1d 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -178,7 +178,7 @@ namespace #elif JUCE_LINUX || JUCE_IOS || JUCE_ANDROID timeval micro; gettimeofday (µ, nullptr); - return micro.tv_usec * 1000.0; + return (double) micro.tv_usec * 1000.0; #elif JUCE_MAC UnsignedWide micro; Microseconds (µ); @@ -446,8 +446,8 @@ private: } else { - entry->range.low = curEntry / (float) numEntries; - entry->range.high = (curEntry + 1) / (float) numEntries; + entry->range.low = (float) curEntry / (float) numEntries; + entry->range.high = (float) (curEntry + 1) / (float) numEntries; entry->range.inclusiveLow = true; entry->range.inclusiveHigh = (curEntry == numEntries - 1); @@ -2878,8 +2878,8 @@ public: { X11Symbols::getInstance()->xMoveResizeWindow (display, pluginWindow, pos.getX(), pos.getY(), - static_cast (roundToInt (getWidth() * nativeScaleFactor)), - static_cast (roundToInt (getHeight() * nativeScaleFactor))); + static_cast (roundToInt ((float) getWidth() * nativeScaleFactor)), + static_cast (roundToInt ((float) getHeight() * nativeScaleFactor))); X11Symbols::getInstance()->xMapRaised (display, pluginWindow); X11Symbols::getInstance()->xFlush (display); @@ -3170,8 +3170,8 @@ private: X11Symbols::getInstance()->xMapRaised (display, pluginWindow); #endif - w = roundToInt (w / nativeScaleFactor); - h = roundToInt (h / nativeScaleFactor); + w = roundToInt ((float) w / nativeScaleFactor); + h = roundToInt ((float) h / nativeScaleFactor); // double-check it's not too tiny w = jmax (w, 32);