From 6610a1959f9ad2c8192579708b2a114a67a1a52d Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 16 Aug 2019 11:44:30 +0100 Subject: [PATCH] Added JUCE_CUSTOM_VST3_SDK flag to juce_audio_processors --- .../Source/LiveBuildEngine/jucer_CompileEngineClient.cpp | 5 ++++- .../Source/ProjectSaving/jucer_ProjectExporter.cpp | 4 +++- modules/juce_audio_processors/juce_audio_processors.h | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp index 03d1596841..134a0fcc82 100644 --- a/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp +++ b/extras/Projucer/Source/LiveBuildEngine/jucer_CompileEngineClient.cpp @@ -466,8 +466,11 @@ private: { paths.addIfNotAlreadyThere (module->getFolder().getParentDirectory().getFullPathName()); - if (module->getID() == "juce_audio_processors" && (project.isAudioPluginProject() || isVSTHost)) + if (module->getID() == "juce_audio_processors" && ((project.isAudioPluginProject() || isVSTHost) + && ! project.isConfigFlagEnabled ("JUCE_CUSTOM_VST3_SDK"))) + { paths.addIfNotAlreadyThere (module->getFolder().getChildFile ("format_types").getChildFile ("VST3_SDK").getFullPathName()); + } } return convertSearchPathsToAbsolute (paths); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp index 4c26959bfa..456975ce8f 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp @@ -396,7 +396,9 @@ void ProjectExporter::addVSTPathsIfPluginOrHost() || ((shouldBuildTargetType (build_tools::ProjectType::Target::VST3PlugIn) && project.shouldBuildVST3()) || project.isVST3PluginHost())) { addLegacyVSTFolderToPathIfSpecified(); - addToExtraSearchPaths (getInternalVST3SDKPath(), 0); + + if (! project.isConfigFlagEnabled ("JUCE_CUSTOM_VST3_SDK")) + addToExtraSearchPaths (getInternalVST3SDKPath(), 0); } } diff --git a/modules/juce_audio_processors/juce_audio_processors.h b/modules/juce_audio_processors/juce_audio_processors.h index e70e84bff4..87cead4abc 100644 --- a/modules/juce_audio_processors/juce_audio_processors.h +++ b/modules/juce_audio_processors/juce_audio_processors.h @@ -86,6 +86,15 @@ #define JUCE_PLUGINHOST_LADSPA 0 #endif +/** Config: JUCE_CUSTOM_VST3_SDK + If enabled, the embedded VST3 SDK in JUCE will not be added to the project and instead you should + add the path to your custom VST3 SDK to the project's header search paths. Most users shouldn't + need to enable this and should just use the version of the SDK included with JUCE. +*/ +#ifndef JUCE_CUSTOM_VST3_SDK + #define JUCE_CUSTOM_VST3_SDK 0 +#endif + #if ! (JUCE_PLUGINHOST_AU || JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_LADSPA) // #error "You need to set either the JUCE_PLUGINHOST_AU and/or JUCE_PLUGINHOST_VST and/or JUCE_PLUGINHOST_VST3 and/or JUCE_PLUGINHOST_LADSPA flags if you're using this module!" #endif