diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_LV2.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_LV2.cpp index 9bc4b0be1a..9d6f085e76 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_LV2.cpp +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_LV2.cpp @@ -61,6 +61,24 @@ namespace juce namespace lv2_client { +constexpr bool startsWithValidScheme (const std::string_view str) +{ + constexpr const char* prefixes[] { "http://", "https://", "urn:" }; + + for (const std::string_view prefix : prefixes) + if (prefix == str.substr (0, prefix.size())) + return true; + + return false; +} + +// If your LV2 plugin fails to build here, it may be because you haven't explicitly set an LV2 URI, +// or you've requested a malformed URI. +// If you're using the Projucer, update the value of the "LV2 URI" field in your project settings. +// If you're using CMake, specify a valid LV2URI argument to juce_add_plugin. +static_assert (startsWithValidScheme (JucePlugin_LV2URI), + "Your configured LV2 URI must include a leading scheme specifier."); + constexpr auto uriSeparator = ":"; const auto JucePluginLV2UriUi = String (JucePlugin_LV2URI) + uriSeparator + "UI"; const auto JucePluginLV2UriState = String (JucePlugin_LV2URI) + uriSeparator + "StateString"; diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index a7b2d35004..4851d1abb4 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include