Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
apt install -y sudo cmake curl tree

- uses: actions/checkout@v4
with:
submodules: true

- name: Setup Environment Variables
shell: bash
Expand All @@ -63,7 +61,7 @@ jobs:

# This needs to be absolute to make action/cache happy
WORKING_DIR=$(pwd)
echo "PLUGIN_CACHE_PATH=$WORKING_DIR/modules/juce/Builds/examples/Plugins" >> $GITHUB_ENV
echo "PLUGIN_CACHE_PATH=$WORKING_DIR/_deps/juce-build/examples/Plugins" >> $GITHUB_ENV

- name: Install dependencies (Linux)
if: ${{ matrix.name == 'Linux' }}
Expand All @@ -90,7 +88,7 @@ jobs:
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: v2-${{ matrix.name }}-${{ env.BUILD_TYPE }}
key: v3-${{ matrix.name }}-${{ env.BUILD_TYPE }}

- name: Configure
shell: bash
Expand All @@ -114,11 +112,10 @@ jobs:
with:
path: ${{ env.PLUGIN_CACHE_PATH }}
# Increment the version in the key below to manually break plugin cache
key: v7-${{ runner.os }}-${{ env.JUCE_SHA1 }}
key: v8-${{ runner.os }}-${{ env.JUCE_SHA1 }}

- name: Build JUCE example plugins
if: steps.cache-plugins.outputs.cache-hit != 'true'
working-directory: modules/juce
shell: bash
run: |
cmake -B Builds -DJUCE_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

43 changes: 25 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@ cmake_minimum_required(VERSION 3.15)
file(STRINGS VERSION CURRENT_VERSION LIMIT_COUNT 1)
project(pluginval VERSION ${CURRENT_VERSION})

if (APPLE)
# Target OS versions down to 10.11
set (CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE INTERNAL "")
# Just compliing pluginval
if (pluginval_IS_TOP_LEVEL)
include(cmake/CPM.cmake)
CPMAddPackage("gh:juce-framework/juce#8.0.3")

# Uncomment to produce a universal binary
# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
if (APPLE)
# Target OS versions down to 10.11
set (CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE INTERNAL "")

# Uncomment to produce a universal binary
# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
endif()

else()
# compiling as a "dependency" of another JUCE CMake project
if (NOT COMMAND juce_add_module)
message(FATAL_ERROR "JUCE must be added to your project before pluginval!")
endif ()
endif()

# sanitizer options, from https://github.com/sudara/cmake-includes/blob/main/Sanitizers.cmake
Expand Down Expand Up @@ -41,12 +53,6 @@ endif ()
set_property(GLOBAL PROPERTY USE_FOLDERS YES)
option(JUCE_ENABLE_MODULE_SOURCE_GROUPS "Enable Module Source Groups" ON)

option(PLUGINVAL_FETCH_JUCE "Fetch JUCE along with PluginVal" ON)

if(PLUGINVAL_FETCH_JUCE)
add_subdirectory(modules/juce)
endif()

if (DEFINED ENV{VST2_SDK_DIR})
MESSAGE(STATUS "Building with VST2 SDK: $ENV{VST2_SDK_DIR}")
juce_set_vst2_sdk_path($ENV{VST2_SDK_DIR})
Expand Down Expand Up @@ -122,11 +128,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-static-libstdc++)
endif()

set (cmdline_docs_out "${CMAKE_CURRENT_LIST_DIR}/docs/Command line options.md")
if (pluginval_IS_TOP_LEVEL)
set (cmdline_docs_out "${CMAKE_CURRENT_LIST_DIR}/docs/Command line options.md")

add_custom_command (OUTPUT "${cmdline_docs_out}"
COMMAND pluginval --help > "${cmdline_docs_out}"
COMMENT "Regenerating Command line options.md..."
USES_TERMINAL)

add_custom_target (PluginvalDocs DEPENDS "${cmdline_docs_out}")
add_custom_command (OUTPUT "${cmdline_docs_out}"
COMMAND pluginval --help > "${cmdline_docs_out}"
COMMENT "Regenerating Command line options.md..."
USES_TERMINAL)
add_custom_target (PluginvalDocs DEPENDS "${cmdline_docs_out}")
endif()
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ cmake -B Builds/Debug -DCMAKE_BUILD_TYPE=Debug . # configure
cmake --build Builds/Debug --config Debug # build
```

### Including within an existing JUCE project

Instead of running as a separate app, you can add pluginval as a CMake target to your existing plugin project. This not only makes for a convenient debugging workflow, it gives you better stack traces.

For example, if you add pluginval as a git submodule like so:
```
git submodule add -b develop git@github.com:Tracktion/pluginval.git modules/pluginval
```

or added with CPM like so:

```
CPMAddPackage("gh:tracktion/pluginval#develop")
```

Then all you need to do is call `add_subdirectory ("modules/pluginval")` in your `CMakeLists.txt`. This should be done **after** your call to `juce_add_plugin`.


### Third-party Installation
###### _Chocolatey (Windows):_
```shell
Expand Down
4 changes: 4 additions & 0 deletions Source/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ namespace
bool isPluginArgument (juce::String arg)
{
juce::AudioPluginFormatManager formatManager;
#if JUCE_VERSION >= 0x08000B
addDefaultFormatsToManager (formatManager);
#else
formatManager.addDefaultFormats();
#endif

for (auto format : formatManager.getFormats())
if (format->fileMightContainThisPluginType (arg))
Expand Down
4 changes: 4 additions & 0 deletions Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ namespace
MainComponent::MainComponent (Validator& v)
: validator (v)
{
#if JUCE_VERSION >= 0x08000B
addDefaultFormatsToManager (formatManager);
#else
formatManager.addDefaultFormats();
#endif

const auto tabCol = getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId);
addAndMakeVisible (tabbedComponent);
Expand Down
4 changes: 4 additions & 0 deletions Source/PluginTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ PluginTests::PluginTests (const juce::String& fileOrIdentifier, Options opts)
{
jassert (fileOrIdentifier.isNotEmpty());
jassert (juce::isPositiveAndNotGreaterThan (options.strictnessLevel, 10));
#if JUCE_VERSION >= 0x08000B
addDefaultFormatsToManager (formatManager);
#else
formatManager.addDefaultFormats();
#endif
}

PluginTests::PluginTests (const juce::PluginDescription& desc, Options opts)
Expand Down
3 changes: 2 additions & 1 deletion Source/tests/BasicTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ namespace ParameterHelpers
const int numSteps = parameter.getNumSteps();
const bool isDiscrete = parameter.isDiscrete();
const bool isBoolean = parameter.isBoolean();
const juce::StringArray allValueStrings = parameter.getAllValueStrings();
const juce::StringArray allValueStrings = parameter.isDiscrete() ? parameter.getAllValueStrings() : juce::StringArray();


const bool isOrientationInverted = parameter.isOrientationInverted();
const bool isAutomatable = parameter.isAutomatable();
Expand Down
24 changes: 24 additions & 0 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.40.2)
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)

include(${CPM_DOWNLOAD_LOCATION})
1 change: 0 additions & 1 deletion modules/juce
Submodule juce deleted from 5179f4
Loading