diff --git a/.github/docker/linux-ci.Dockerfile b/.github/docker/linux-ci.Dockerfile index 73b5560c..4d912c94 100644 --- a/.github/docker/linux-ci.Dockerfile +++ b/.github/docker/linux-ci.Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update \ && wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > /usr/share/keyrings/llvm.gpg \ && echo "deb [signed-by=/usr/share/keyrings/llvm.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" > /etc/apt/sources.list.d/llvm.list \ && apt-get update \ - && apt-get install -y clang-18 lld-18 ninja-build libstdc++-12-dev libasound2-dev libjack-jackd2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libxcomposite-dev libxcursor-dev libxrandr-dev libxrender-dev libfreetype6-dev libfontconfig1-dev libwebkit2gtk-4.1-dev libglu1-mesa-dev mesa-common-dev ladspa-sdk intel-oneapi-ipp-devel \ + && apt-get install -y clang-18 lld-18 ninja-build libstdc++-12-dev libasound2-dev libjack-jackd2-dev libcurl4-openssl-dev libx11-dev libxi-dev libxinerama-dev libxext-dev libxcomposite-dev libxcursor-dev libxrandr-dev libxrender-dev libfreetype6-dev libfontconfig1-dev libwebkit2gtk-4.1-dev libglu1-mesa-dev mesa-common-dev ladspa-sdk intel-oneapi-ipp-devel \ && ln -sf /usr/bin/ld.lld-18 /usr/local/bin/ld.lld \ && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9d3d1684..65680148 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -67,7 +67,7 @@ jobs: wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.1-dev libglu1-mesa-dev xvfb ninja-build intel-oneapi-ipp-devel + sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxi-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.1-dev libglu1-mesa-dev xvfb ninja-build intel-oneapi-ipp-devel sudo /usr/bin/Xvfb $DISPLAY & - name: Install IPP (Windows) @@ -84,12 +84,12 @@ jobs: run: brew install ninja osxutils - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: submodules: recursive - name: Cache the build - uses: mozilla-actions/sccache-action@v0.0.10 + uses: mozilla-actions/sccache-action@v0.0.11 - name: Configure run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ matrix.extra-flags }} . @@ -119,7 +119,7 @@ jobs: - name: Pluginval run: | - curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.3/pluginval_${{ runner.os }}.zip" + curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.4/pluginval_${{ runner.os }}.zip" 7z x pluginval_${{ runner.os }}.zip ${{ matrix.pluginval-binary }} --strictness-level 10 --verbose --validate "${{ env.VST3_PATH }}" @@ -250,7 +250,7 @@ jobs: uses: actions/download-artifact@v8 - name: Create Release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: prerelease: true # download-artifact puts these files in their own dirs... @@ -258,4 +258,4 @@ jobs: files: | */*.exe */*.zip - */*.dmg + */*.pkg diff --git a/.github/workflows/linux-ci-image.yml b/.github/workflows/linux-ci-image.yml index 1119aab6..e56344d0 100644 --- a/.github/workflows/linux-ci-image.yml +++ b/.github/workflows/linux-ci-image.yml @@ -12,7 +12,7 @@ jobs: packages: write contents: read steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Login to ghcr run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin diff --git a/CLAUDE.md b/CLAUDE.md index aae04b2a..4174c196 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,11 +77,18 @@ On macOS for universal binary: `-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"` **CMake Modules**: - `PamplejuceVersion.cmake` - Reads VERSION file, optional auto-bump patch level -- `Assets.cmake` - Auto-includes all files in assets/ as binary data -- `Tests.cmake` - Configures Catch2 test target -- `Benchmarks.cmake` - Configures Catch2 benchmark target +- `PamplejuceFunctions.cmake` - One include that defines the `pamplejuce_*` functions below (and turns off their legacy include-time behavior) - `PamplejuceIPP.cmake` - Intel IPP integration (optional) +Target setup happens via explicit function calls in `CMakeLists.txt`, not at include time: +- `pamplejuce_add_assets()` - Includes all files in assets/ as binary data (from `Assets.cmake`) +- `pamplejuce_add_tests()` - Configures the Catch2 test target (from `Tests.cmake`) +- `pamplejuce_add_benchmarks()` - Configures the Catch2 benchmark target (from `Benchmarks.cmake`) +- `pamplejuce_shared_code_defaults()` - C++23, fast math (from `SharedCodeDefaults.cmake`) +- `pamplejuce_xcode_prettify()` - Xcode folder/scheme cleanup (from `XcodePrettify.cmake`) + +Note: after `include(PamplejuceFunctions)`, a plain `include(Tests)` (or Assets, etc.) is a no-op - call the function instead. + **Test Discovery**: Uses `catch_discover_tests()` with `PRE_TEST` discovery mode for Xcode compatibility. ## Key Configuration diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e49f01b..ba482f85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,9 @@ project(${PROJECT_NAME} VERSION ${CURRENT_VERSION}) # Log build environment info (after project() so compiler info is available) include(PamplejuceLog) +# Defines the pamplejuce_* functions we call below (also fetches Catch2 at include time) +include(PamplejuceFunctions) + # JUCE is setup as a submodule in the /JUCE folder # Locally, you must run `git submodule update --init --recursive` once # and later `git submodule update --remote --merge` to keep it up to date @@ -100,8 +103,8 @@ clap_juce_extensions_plugin(TARGET "${PROJECT_NAME}" CLAP_ID "${BUNDLE_ID}" CLAP_FEATURES audio-effect) -# Enable fast math, C++20 and a few other target defaults -include(SharedCodeDefaults) +# Enable fast math, C++23 and a few other target defaults +pamplejuce_shared_code_defaults() # Manually list all .h and .cpp files for the plugin @@ -113,10 +116,10 @@ file(GLOB_RECURSE SourceFiles CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/sou target_sources(SharedCode INTERFACE ${SourceFiles}) # Adds a BinaryData target for embedding assets into the binary -include(Assets) +pamplejuce_add_assets() # MacOS only: Cleans up folder and target organization on Xcode. -include(XcodePrettify) +pamplejuce_xcode_prettify() # This is where you can set preprocessor definitions for JUCE and your plugin target_compile_definitions(SharedCode @@ -163,10 +166,10 @@ target_link_libraries("${PROJECT_NAME}" PRIVATE SharedCode) include(PamplejuceIPP) # Everything related to the tests target -include(Tests) +pamplejuce_add_tests() # A separate target for Benchmarks (keeps the Tests target fast) -include(Benchmarks) +pamplejuce_add_benchmarks() # Output some config for CI (like our PRODUCT_NAME) include(GitHubENV) diff --git a/JUCE b/JUCE index 7c9d3783..620b879e 160000 --- a/JUCE +++ b/JUCE @@ -1 +1 @@ -Subproject commit 7c9d3783b127263d72bb65fe0a7e2dc8a02a7ac2 +Subproject commit 620b879ef7aaba832c5a36d9040ac54ed29025c1 diff --git a/README.md b/README.md index 84ba6b80..fbd9e55f 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ Pamplejuce is a ~~template~~ lifestyle for creating and building JUCE plugins in Out-of-the-box, it: 1. Runs C++23 -2. Uses JUCE 8.x as a git submodule (tracking develop). +2. Uses JUCE 9.x as a git submodule (tracking develop). 3. Uses CPM for dependency management. 3. Relies on CMake 3.25 and higher for cross-platform building. -4. Has [Catch2](https://github.com/catchorg/Catch2) v3.7.1 for the test framework and runner. +4. Has [Catch2](https://github.com/catchorg/Catch2) v3.8.1 for the test framework and runner. 5. Includes a `Tests` target and a `Benchmarks` target with examples to get started quickly. 6. Has [Melatonin Inspector](https://github.com/sudara/melatonin_inspector) installed as a JUCE module to help relieve headaches when building plugin UI. diff --git a/benchmarks/Benchmarks.cpp b/benchmarks/Benchmarks.cpp index ac262eff..de678f64 100644 --- a/benchmarks/Benchmarks.cpp +++ b/benchmarks/Benchmarks.cpp @@ -23,7 +23,7 @@ TEST_CASE ("Boot performance") // due to complex construction logic of the editor, let's measure open/close together meter.measure ([&] (int /* i */) { - auto editor = plugin.createEditorIfNeeded(); + auto editor = plugin.createEditorAndMakeActive(); plugin.editorBeingDeleted (editor); delete editor; return plugin.getActiveEditor(); diff --git a/cmake b/cmake index 8d786969..5d75b1f7 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 8d786969e54caaf7251fffc2b8c0e01fe1512256 +Subproject commit 5d75b1f77180c181fc0a85d8d80d7d34341fda51 diff --git a/modules/clap-juce-extensions b/modules/clap-juce-extensions index e1f67893..c1a5ad02 160000 --- a/modules/clap-juce-extensions +++ b/modules/clap-juce-extensions @@ -1 +1 @@ -Subproject commit e1f67893cc409a40c1154fa2e78c97046da24ce0 +Subproject commit c1a5ad025f95d01e03267857fa8276ebeed16500 diff --git a/modules/melatonin_inspector b/modules/melatonin_inspector index 8f0b23aa..9c483f86 160000 --- a/modules/melatonin_inspector +++ b/modules/melatonin_inspector @@ -1 +1 @@ -Subproject commit 8f0b23aae1ac9ca185fa62c09cfde477fc2dda00 +Subproject commit 9c483f865854d83fe9873e1c20e3fd772f695f80 diff --git a/source/PluginProcessor.cpp b/source/PluginProcessor.cpp index 16fe17c1..7ec71d7b 100644 --- a/source/PluginProcessor.cpp +++ b/source/PluginProcessor.cpp @@ -75,7 +75,8 @@ void PluginProcessor::setCurrentProgram (int index) const juce::String PluginProcessor::getProgramName (int index) { juce::ignoreUnused (index); - return {}; + // Steinberg's VST3 validator fails plugins whose single default program has no name + return "Default"; } void PluginProcessor::changeProgramName (int index, const juce::String& newName) diff --git a/tests/PluginBasics.cpp b/tests/PluginBasics.cpp index 38c5e470..487de7d2 100644 --- a/tests/PluginBasics.cpp +++ b/tests/PluginBasics.cpp @@ -17,6 +17,12 @@ TEST_CASE ("Plugin instance", "[instance]") CHECK_THAT (testPlugin.getName().toStdString(), Catch::Matchers::Equals ("Pamplejuce Demo")); } + + SECTION ("program name") + { + // Steinberg's VST3 validator fails plugins whose programs have no name + CHECK (testPlugin.getProgramName (0).isNotEmpty()); + } } diff --git a/tests/helpers/test_helpers.h b/tests/helpers/test_helpers.h index cda9938c..5e2b0841 100644 --- a/tests/helpers/test_helpers.h +++ b/tests/helpers/test_helpers.h @@ -22,7 +22,7 @@ [[maybe_unused]] static void runWithinPluginEditor (const std::function& testCode) { PluginProcessor plugin; - const auto editor = plugin.createEditorIfNeeded(); + const auto editor = plugin.createEditorAndMakeActive(); testCode (plugin);