From f27a7c771219d483eb8de3cfecfce8beaa8194c1 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 20 Oct 2020 16:49:26 +0100 Subject: [PATCH] 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..ec6061dbb8 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -1,6 +1,37 @@ JUCE breaking changes ===================== +Develop +======= + +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 0369ec8b6d..3abd1b92da 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