Skip to content

Commit

Permalink
Update Pamplejuce and add linux and windows configurations in launch.…
Browse files Browse the repository at this point in the history
…json (#43)
  • Loading branch information
vberthiaume authored Oct 30, 2024
1 parent 0d2a327 commit 6c185ce
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 32 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
DISPLAY: :0 # linux pluginval needs this
HOMEBREW_NO_INSTALL_CLEANUP: 1
SCCACHE_GHA_ENABLED: true
SCCACHE_CACHE_MULTIARCH: 1
IPP_DIR: C:\Program Files (x86)\Intel\oneAPI\ipp\latest\lib\cmake\ipp

defaults:
Expand All @@ -35,7 +36,7 @@ jobs:
matrix:
include:
- name: Linux
os: ubuntu-20.04
os: ubuntu-24.04
pluginval-binary: ./pluginval
- name: macOS
os: macos-14
Expand All @@ -59,7 +60,7 @@ jobs:
if: runner.os == 'Linux'
# Thanks to McMartin & co https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/44
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev xvfb ninja-build
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
sudo /usr/bin/Xvfb $DISPLAY &
- name: Cache IPP (Windows)
Expand Down
56 changes: 41 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Builds/ProPhat_artefacts/Debug/Standalone/ProPhat.app",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch - Linux",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Builds/ProPhat_artefacts/Debug/Standalone/ProPhat",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
},
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Builds/ProPhat_artefacts/Debug/Standalone/ProPhat.app",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
},
{
"name": "(gdb) Launch - Windows",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\Builds\\ProPhat_artefacts\\Debug\\Standalone\\ProPhat.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\path\\to\\gdb.exe"
}
]
}
2 changes: 1 addition & 1 deletion JUCE
Submodule JUCE updated 779 files
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ A **phat** virtual synthesizer inspired by the Prophet REV2!

To build:
- With Visual Studio on Windows: `cmake -B Builds`
- with Xcode on Mac: `cmake -B Builds -G Xcode`
- with Visual Studio Code on Mac:
- With Xcode on Mac: `cmake -B Builds -G Xcode`
- With Visual Studio Code on Mac:
- open the folder in Visual Studio Code
- make sure your CMake extension is configured to use the `Builds` folder (`cmd/ctrl + ,`, then set `Cmake: Build Directory` to `${workspaceFolder}/Builds`)
- cmd/ctrl + shift + P, then `CMake: Configure`
- F7 to build
- F5 to run
- With Visual Studio Code on Ubuntu 24.04:
- same as for mac right above, but make sure to install all dependencies like this: `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 ladspa-sdk libcurl4-openssl-dev libxcomposite-dev libxcursor-dev libxrandr-dev mesa-common-dev libjack-dev sccache`
4 changes: 0 additions & 4 deletions benchmarks/Benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ TEST_CASE ("Boot performance")
BENCHMARK_ADVANCED ("Processor constructor")
(Catch::Benchmark::Chronometer meter)
{
auto gui = juce::ScopedJuceInitialiser_GUI {};
std::vector<Catch::Benchmark::storage_for<ProPhatProcessor>> storage (size_t (meter.runs()));
meter.measure ([&] (int i) { storage[(size_t) i].construct(); });
};

BENCHMARK_ADVANCED ("Processor destructor")
(Catch::Benchmark::Chronometer meter)
{
auto gui = juce::ScopedJuceInitialiser_GUI {};
std::vector<Catch::Benchmark::destructable_object<ProPhatProcessor>> storage (size_t (meter.runs()));
for (auto& s : storage)
s.construct();
Expand All @@ -25,8 +23,6 @@ TEST_CASE ("Boot performance")
BENCHMARK_ADVANCED ("Editor open and close")
(Catch::Benchmark::Chronometer meter)
{
auto gui = juce::ScopedJuceInitialiser_GUI {};

ProPhatProcessor plugin;

// due to complex construction logic of the editor, let's measure open/close together
Expand Down
17 changes: 17 additions & 0 deletions benchmarks/Catch2Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// All test files are included in the executable via the Glob in CMakeLists.txt

#include "juce_gui_basics/juce_gui_basics.h"
#include <catch2/catch_session.hpp>

int main (int argc, char* argv[])
{
// This lets us use JUCE's MessageManager without leaking.
// PluginProcessor might need this if you use the APVTS for example.
// You'll also need it for tests that rely on juce::Graphics, juce::Timer, etc.
// It's nicer DX when placed here vs. manually in Catch2 SECTIONs
juce::ScopedJuceInitialiser_GUI gui;

const int result = Catch::Session().run (argc, argv);

return result;
}
4 changes: 2 additions & 2 deletions packaging/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Name: "standalone"; Description: "Standalone application"; Types: full custom
Name: "vst3"; Description: "VST3 plugin"; Types: full custom

[Setup]
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64compatible
ArchitecturesAllowed=x64compatible
AppName={#ProductName}
OutputBaseFilename={#ProductName}-{#Version}-Windows
AppCopyright=Copyright (C) {#Year} {#Publisher}
Expand Down
18 changes: 18 additions & 0 deletions tests/Catch2Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// All test files are included in the executable via the Glob in CMakeLists.txt

#include "juce_gui_basics/juce_gui_basics.h"
#include <catch2/catch_session.hpp>

int main (int argc, char* argv[])
{
// This lets us use JUCE's MessageManager without leaking.
// PluginProcessor might need this if you use the APVTS for example.
// You'll also need it for tests that rely on juce::Graphics, juce::Timer, etc.
// It's nicer DX when placed here vs. manually in Catch2 SECTIONs
juce::ScopedJuceInitialiser_GUI gui;

const int result = Catch::Session().run (argc, argv);

return result;
}
#include <catch2/catch_test_macros.hpp>
5 changes: 0 additions & 5 deletions tests/PluginBasics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ TEST_CASE ("Plugin instance", "[instance]")
{
ProPhatProcessor testPlugin;

// This lets us use JUCE's MessageManager without leaking.
// PluginProcessor might need this if you use the APVTS for example.
// You'll also need it for tests that rely on juce::Graphics, juce::Timer, etc.
auto gui = juce::ScopedJuceInitialiser_GUI {};

SECTION ("name")
{
CHECK_THAT (testPlugin.getName().toStdString(),
Expand Down
1 change: 0 additions & 1 deletion tests/helpers/test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
[[maybe_unused]] void runWithinPluginEditor (const std::function<void (ProPhatProcessor& plugin)>& testCode)
{
ProPhatProcessor plugin;
auto gui = juce::ScopedJuceInitialiser_GUI {};
auto editor = plugin.createEditorIfNeeded();

testCode (plugin);
Expand Down

0 comments on commit 6c185ce

Please sign in to comment.