From 10f6bd34a7ba30a6cb1f2f5ab2ef8112044f968b Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 18 Apr 2024 19:18:56 +0100 Subject: [PATCH] AAX: Projucer, use bundled copy of the AAX SDK by default --- .../jucer_GlobalPathsWindowComponent.h | 3 +- .../ProjectSaving/jucer_ProjectExport_MSVC.h | 12 ++-- .../ProjectSaving/jucer_ProjectExporter.cpp | 13 ++--- .../ProjectSaving/jucer_ProjectExporter.h | 11 +++- .../Source/Settings/jucer_StoredSettings.cpp | 58 ++++++++----------- 5 files changed, 47 insertions(+), 50 deletions(-) diff --git a/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h index 848272e98b..1d0efa7e9a 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_GlobalPathsWindowComponent.h @@ -240,7 +240,8 @@ private: if (getSelectedOS() != TargetOS::linux) { builder.add (new FilePathPropertyComponent (aaxPathValue, "AAX SDK", true, isThisOS), - "If you are building AAX plug-ins, this should be the path to the AAX SDK folder."); + "If you need to use a custom version of the AAX SDK, this should be the path to the AAX SDK folder. " + "JUCE bundles a copy of the AAX SDK, so you normally shouldn't need to set this."); } builder.add (new FilePathPropertyComponent (androidSDKPathValue, "Android SDK", true, isThisOS), diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 15ef5a2c18..7006867aef 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -1243,7 +1243,7 @@ public: //============================================================================== build_tools::RelativePath getAAXIconFile() const { - build_tools::RelativePath aaxSDK (owner.getAAXPathString(), build_tools::RelativePath::projectFolder); + const auto aaxSdk = owner.getAAXPathRelative(); build_tools::RelativePath projectIcon ("icon.ico", build_tools::RelativePath::buildTargetFolder); if (getOwner().getTargetFolder().getChildFile ("icon.ico").existsAsFile()) @@ -1251,7 +1251,7 @@ public: getOwner().getProject().getProjectFolder(), build_tools::RelativePath::projectFolder); - return aaxSDK.getChildFile ("Utilities").getChildFile ("PlugIn.ico"); + return aaxSdk.getChildFile ("Utilities").getChildFile ("PlugIn.ico"); } String getExtraPostBuildSteps (const MSVCBuildConfiguration& config) const @@ -1276,10 +1276,10 @@ public: if (type == AAXPlugIn) { - const build_tools::RelativePath aaxSDK (owner.getAAXPathString(), build_tools::RelativePath::projectFolder); - const build_tools::RelativePath aaxLibsFolder = aaxSDK.getChildFile ("Libs"); - const build_tools::RelativePath bundleScript = aaxSDK.getChildFile ("Utilities").getChildFile ("CreatePackage.bat"); - const build_tools::RelativePath iconFilePath = getAAXIconFile(); + const auto aaxSdk = owner.getAAXPathRelative(); + const auto aaxLibsFolder = aaxSdk.getChildFile ("Libs"); + const auto bundleScript = aaxSdk.getChildFile ("Utilities").getChildFile ("CreatePackage.bat"); + const auto iconFilePath = getAAXIconFile(); const auto segments = getAaxBundleStructure (config); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp index cb11e205ad..85e877fad6 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp @@ -460,16 +460,11 @@ build_tools::RelativePath ProjectExporter::getInternalVST3SDKPath() void ProjectExporter::addAAXFoldersToPath() { - auto aaxFolder = getAAXPathString(); + const auto aaxFolder = getAAXPathRelative(); - if (aaxFolder.isNotEmpty()) - { - build_tools::RelativePath aaxFolderPath (aaxFolder, build_tools::RelativePath::projectFolder); - - addToExtraSearchPaths (aaxFolderPath); - addToExtraSearchPaths (aaxFolderPath.getChildFile ("Interfaces")); - addToExtraSearchPaths (aaxFolderPath.getChildFile ("Interfaces").getChildFile ("ACF")); - } + addToExtraSearchPaths (aaxFolder); + addToExtraSearchPaths (aaxFolder.getChildFile ("Interfaces")); + addToExtraSearchPaths (aaxFolder.getChildFile ("Interfaces").getChildFile ("ACF")); } void ProjectExporter::addARAFoldersToPath() diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h index e766c315db..c06cb3e851 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.h @@ -184,7 +184,16 @@ public: bool shouldUseGNUExtensions() const { return gnuExtensionsValue.get(); } String getVSTLegacyPathString() const { return vstLegacyPathValueWrapper.getCurrentValue(); } - String getAAXPathString() const { return aaxPathValueWrapper.getCurrentValue(); } + + auto getAAXPathRelative() const + { + const String userAaxFolder = aaxPathValueWrapper.getCurrentValue(); + return userAaxFolder.isNotEmpty() + ? build_tools::RelativePath (userAaxFolder, build_tools::RelativePath::projectFolder) + : getModuleFolderRelativeToProject ("juce_audio_plugin_client").getChildFile ("AAX") + .getChildFile ("SDK"); + } + String getARAPathString() const { return araPathValueWrapper.getCurrentValue(); } // NB: this is the path to the parent "modules" folder that contains the named module, not the diff --git a/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp b/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp index 6adeef84d9..4612b44443 100644 --- a/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp +++ b/extras/Projucer/Source/Settings/jucer_StoredSettings.cpp @@ -356,43 +356,38 @@ bool StoredSettings::isJUCEPathIncorrect() static String getFallbackPathForOS (const Identifier& key, DependencyPathOS os) { if (key == Ids::jucePath) - { return (os == TargetOS::windows ? "C:\\JUCE" : "~/JUCE"); - } - else if (key == Ids::defaultJuceModulePath) - { + + if (key == Ids::defaultJuceModulePath) return (os == TargetOS::windows ? "C:\\JUCE\\modules" : "~/JUCE/modules"); - } - else if (key == Ids::defaultUserModulePath) - { + + if (key == Ids::defaultUserModulePath) return (os == TargetOS::windows ? "C:\\modules" : "~/modules"); - } - else if (key == Ids::vstLegacyPath) + + if (key == Ids::vstLegacyPath) + return {}; + + if (key == Ids::aaxPath) + return {}; // Empty means "use internal SDK" + + if (key == Ids::araPath) { + if (os == TargetOS::windows) return "C:\\SDKs\\ARA_SDK"; + if (os == TargetOS::osx) return "~/SDKs/ARA_SDK"; return {}; } - else if (key == Ids::aaxPath) + + if (key == Ids::androidSDKPath) { - if (os == TargetOS::windows) return "C:\\SDKs\\AAX"; - else if (os == TargetOS::osx) return "~/SDKs/AAX"; - else return {}; // no AAX on this OS! - } - else if (key == Ids::araPath) - { - if (os == TargetOS::windows) return "C:\\SDKs\\ARA_SDK"; - else if (os == TargetOS::osx) return "~/SDKs/ARA_SDK"; - else return {}; - } - else if (key == Ids::androidSDKPath) - { - if (os == TargetOS::windows) return "${user.home}\\AppData\\Local\\Android\\Sdk"; - else if (os == TargetOS::osx) return "${user.home}/Library/Android/sdk"; - else if (os == TargetOS::linux) return "${user.home}/Android/Sdk"; + if (os == TargetOS::windows) return "${user.home}\\AppData\\Local\\Android\\Sdk"; + if (os == TargetOS::osx) return "${user.home}/Library/Android/sdk"; + if (os == TargetOS::linux) return "${user.home}/Android/Sdk"; jassertfalse; return {}; } - else if (key == Ids::androidStudioExePath) + + if (key == Ids::androidStudioExePath) { if (os == TargetOS::windows) { @@ -405,14 +400,11 @@ static String getFallbackPathForOS (const Identifier& key, DependencyPathOS os) return "C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe"; } - else if (os == TargetOS::osx) - { + + if (os == TargetOS::osx) return "/Applications/Android Studio.app"; - } - else - { - return {}; // no Android Studio on this OS! - } + + return {}; // no Android Studio on this OS! } // unknown key!