diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index edbdf6aef9..79728c8a70 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -4,6 +4,32 @@ JUCE breaking changes develop ======= +Change +------ +The minimum supported AAX library version has been bumped to 2.4.0 and the +library is now built automatically while building an AAX plugin. The +JucePlugin_AAXLibs_path preprocessor definition is no longer defined in AAX +plugin builds. + +Possible Issues +--------------- +Projects that use the JucePlugin_AAXLibs_path definition may no longer build +correctly. Projects that reference an AAX library version earlier than 2.4.0 +will fail to build. + +Workaround +---------- +You must download an AAX library distribution with a version of at least 2.4.0. +Use the definition JucePlugin_Build_AAX to check whether the AAX format is +enabled at build time. + +Rationale +--------- +The JUCE framework now requires features only present in version 2.4.0 of the +AAX library. The build change removes steps from the build process, and ensures +that the same compiler flags are used across the entire project. + + Change ------ The implementation of ColourGradient::createLookupTable has been updated to use diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index 4cf4dba72c..9e0475bc5b 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -2007,12 +2007,7 @@ function(juce_set_aax_sdk_path path) message(FATAL_ERROR "Could not find AAX SDK at the specified path: ${path}") endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - add_library(juce_aax_sdk STATIC IMPORTED GLOBAL) - set_target_properties(juce_aax_sdk PROPERTIES - IMPORTED_LOCATION_DEBUG "${path}/Libs/Debug/libAAXLibrary_libcpp.a" - IMPORTED_LOCATION "${path}/Libs/Release/libAAXLibrary_libcpp.a") - elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + if((CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR (CMAKE_SYSTEM_NAME STREQUAL "Windows")) add_library(juce_aax_sdk INTERFACE IMPORTED GLOBAL) else() return() @@ -2022,7 +2017,6 @@ function(juce_set_aax_sdk_path path) "${path}" "${path}/Interfaces" "${path}/Interfaces/ACF") - target_compile_definitions(juce_aax_sdk INTERFACE JucePlugin_AAXLibs_path="${path}/Libs") set_target_properties(juce_aax_sdk PROPERTIES INTERFACE_JUCE_AAX_DEFAULT_ICON "${path}/Utilities/PlugIn.ico") endfunction() diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 96fb439b7c..8446c05ebd 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -1172,7 +1172,6 @@ public: } defines = mergePreprocessorDefs (defines, getOwner().getAllPreprocessorDefs (config, type)); - addExtraPreprocessorDefines (defines); if (getTargetFileType() == staticLibrary || getTargetFileType() == sharedLibraryOrDLL) defines.set("_LIB", ""); @@ -1352,15 +1351,6 @@ public: return preBuild + String (preBuild.isNotEmpty() && extraPreBuild.isNotEmpty() ? "\r\n" : "") + extraPreBuild; } - void addExtraPreprocessorDefines (StringPairArray& defines) const - { - if (type == AAXPlugIn) - { - auto aaxLibsFolder = build_tools::RelativePath (owner.getAAXPathString(), build_tools::RelativePath::projectFolder).getChildFile ("Libs"); - defines.set ("JucePlugin_AAXLibs_path", createRebasedPath (aaxLibsFolder)); - } - } - String getBinaryNameWithSuffix (const MSVCBuildConfiguration& config) const { return config.getOutputFilename (getTargetSuffix(), true, type); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index 95aaa9fcbc..892babbdd4 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -1718,8 +1718,8 @@ public: s.set ("COMBINE_HIDPI_IMAGES", "YES"); { - StringArray linkerFlags, librarySearchPaths; - getLinkerSettings (config, linkerFlags, librarySearchPaths); + StringArray linkerFlags; + getLinkerSettings (config, linkerFlags); for (const auto& weakFramework : owner.xcodeWeakFrameworks) linkerFlags.add ("-weak_framework " + weakFramework); @@ -1727,6 +1727,7 @@ public: if (linkerFlags.size() > 0) s.set ("OTHER_LDFLAGS", linkerFlags.joinIntoString (" ").quoted()); + StringArray librarySearchPaths; librarySearchPaths.addArray (config.getLibrarySearchPaths()); if (type == LV2PlugIn) @@ -1819,23 +1820,13 @@ public: } //============================================================================== - void getLinkerSettings (const BuildConfiguration& config, StringArray& flags, StringArray& librarySearchPaths) const + void getLinkerSettings (const BuildConfiguration& config, StringArray& flags) const { if (getTargetFileType() == pluginBundle) flags.add (owner.isiOS() ? "-bitcode_bundle" : "-bundle"); if (type != Target::SharedCodeTarget && type != Target::LV2TurtleProgram) { - Array extraLibs; - - addExtraLibsForTargetType (config, extraLibs); - - for (auto& lib : extraLibs) - { - flags.add (getLinkerFlagForLib (lib.getFileNameWithoutExtension())); - librarySearchPaths.add (owner.getSearchPathForStaticLibrary (lib)); - } - if (owner.project.isAudioPluginProject()) { if (owner.getTargetOfType (Target::SharedCodeTarget) != nullptr) @@ -2016,19 +2007,6 @@ public: xcodeFrameworks.add ("AudioUnit"); } - void addExtraLibsForTargetType (const BuildConfiguration& config, Array& extraLibs) const - { - if (type == AAXPlugIn) - { - auto aaxLibsFolder = build_tools::RelativePath (owner.getAAXPathString(), build_tools::RelativePath::projectFolder).getChildFile ("Libs"); - - String libraryPath (config.isDebug() ? "Debug" : "Release"); - libraryPath += "/libAAXLibrary_libcpp.a"; - - extraLibs.add (aaxLibsFolder.getChildFile (libraryPath)); - } - } - //============================================================================== const XcodeProjectExporter& owner; 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 f0c7228853..3069d6585f 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -26,7 +26,7 @@ #include #include "../utility/juce_CheckSettingMacros.h" -#if JucePlugin_Build_AAX && (JUCE_INCLUDED_AAX_IN_MM || defined (_WIN32) || defined (_WIN64)) +#if JucePlugin_Build_AAX && (JUCE_MAC || JUCE_WINDOWS) #include "../utility/juce_IncludeSystemHeaders.h" #include "../utility/juce_IncludeModuleHeaders.h" @@ -48,7 +48,9 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", #include -static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p3p0_REVISION, "JUCE requires AAX SDK version 2.3.0 or higher"); +static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p4p0_REVISION, "JUCE requires AAX SDK version 2.4.0 or higher"); + +#define INITACFIDS #include #include @@ -70,49 +72,15 @@ static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p3p0_REVISION, "JUCE require #include #include #include - -#if defined (AAX_SDK_2p3p1_REVISION) && AAX_SDK_2p3p1_REVISION <= AAX_SDK_CURRENT_REVISION - #include - #include -#endif - -#if defined (AAX_SDK_2p4p0_REVISION) && AAX_SDK_2p4p0_REVISION <= AAX_SDK_CURRENT_REVISION - #define JUCE_AAX_HAS_TRANSPORT_NOTIFICATION 1 -#else - #define JUCE_AAX_HAS_TRANSPORT_NOTIFICATION 0 -#endif - -#if JUCE_AAX_HAS_TRANSPORT_NOTIFICATION - #include -#endif +#include +#include +#include JUCE_END_IGNORE_WARNINGS_MSVC JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wfour-char-constants") -#if JUCE_WINDOWS - #ifndef JucePlugin_AAXLibs_path - #error "You need to define the JucePlugin_AAXLibs_path macro. (This is best done via the Projucer)" - #endif - - #if JUCE_64BIT - #define JUCE_AAX_LIB "AAXLibrary_x64" - #else - #define JUCE_AAX_LIB "AAXLibrary" - #endif - - #if JUCE_DEBUG - #define JUCE_AAX_LIB_PATH "\\Debug\\" - #define JUCE_AAX_LIB_SUFFIX "_D" - #else - #define JUCE_AAX_LIB_PATH "\\Release\\" - #define JUCE_AAX_LIB_SUFFIX "" - #endif - - #pragma comment(lib, JucePlugin_AAXLibs_path JUCE_AAX_LIB_PATH JUCE_AAX_LIB JUCE_AAX_LIB_SUFFIX ".lib") -#endif - #undef check #include "juce_AAX_Modifier_Injector.h" @@ -1260,7 +1228,6 @@ namespace AAXClasses break; } - #if JUCE_AAX_HAS_TRANSPORT_NOTIFICATION case AAX_eNotificationEvent_TransportStateChanged: if (data != nullptr) { @@ -1268,7 +1235,6 @@ namespace AAXClasses recordingState.set (info.mIsRecording); } break; - #endif } return AAX_CEffectParameters::NotificationReceived (type, data, size); @@ -2415,9 +2381,7 @@ namespace AAXClasses properties->AddProperty (AAX_eProperty_SupportsSaveRestore, false); #endif - #if JUCE_AAX_HAS_TRANSPORT_NOTIFICATION properties->AddProperty (AAX_eProperty_ObservesTransportState, true); - #endif if (fullLayout.getChannelSet (true, 1) == AudioChannelSet::mono()) { diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX_utils.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX_utils.cpp new file mode 100644 index 0000000000..a0b994c315 --- /dev/null +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AAX_utils.cpp @@ -0,0 +1,103 @@ +/* + ============================================================================== + + This file is part of the JUCE library. + Copyright (c) 2022 - Raw Material Software Limited + + JUCE is an open source library subject to commercial or open-source + licensing. + + By using JUCE, you agree to the terms of both the JUCE 7 End-User License + Agreement and JUCE Privacy Policy. + + End User License Agreement: www.juce.com/juce-7-licence + Privacy Policy: www.juce.com/juce-privacy-policy + + Or: You may also use this code under the terms of the GPL v3 (see + www.gnu.org/licenses). + + JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + ============================================================================== +*/ + +#include + +#if JucePlugin_Build_AAX && (JUCE_MAC || JUCE_WINDOWS) + +#include + +static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p4p0_REVISION, "JUCE requires AAX SDK version 2.4.0 or higher"); + +#if JUCE_INTEL || (JUCE_MAC && JUCE_ARM) + +#include + +// Utilities +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") +#include +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wunused-parameter", + "-Wshift-sign-overflow", + "-Wextra-semi", + "-Wzero-as-null-pointer-constant", + "-Winconsistent-missing-destructor-override", + "-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6001 6053 4996 5033 4068 4996) + +#include +#include + +#if defined(_WIN32) && ! defined(WIN32) + #define WIN32 +#endif +#include + +#include +#include +#include + +// Versioned Interfaces +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + +#else + #error "This version of the AAX SDK does not support the current platform." +#endif +#endif