Skip to content

Commit

Permalink
Add a Consolidated JUCE plugin side by side with Rack (#30)
Browse files Browse the repository at this point in the history
With optional build etc...
  • Loading branch information
baconpaul authored Apr 23, 2024
1 parent 51ac3a9 commit 6158d03
Show file tree
Hide file tree
Showing 20 changed files with 3,925 additions and 124 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-daw-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build DAW Plugin
on:
push:
branches:
- main
- 'releases/**'
tags:
- 'v**'
pull_request:
workflow_dispatch:
workflow_run:
workflows: ["Update"]
types:
- completed

defaults:
run:
shell: bash

jobs:
build_plugin:
name: DAW Build - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Linux Deps; pick GCC9
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt install libasound2-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libfreetype6-dev libglu1-mesa-dev libjack-jackd2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
- name: Build project
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DBUILD_JUCE_PLUGIN=TRUE
cmake --build ./build --config Release --target awcons-installer
- name: Show Build Directory
run: |
ls -l ./build
- name: Show Installer Directory
run: |
ls -l ./build/installer
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: build/installer
name: dawplugin-${{ matrix.os }}
74 changes: 59 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,79 @@
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

project(Airwin2Rack VERSION 1.0 LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)

add_subdirectory(libs/sst-rackhelpers)

set(PLUGIN_NAME ${PROJECT_NAME})
set(ADDITIONAL_PLUGIN_DISTRIBUTABLES res LICENSE.md README.md)
include(RackSDK.cmake)
option(BUILD_JUCE_PLUGIN "Build a JUCE plugin" OFF)
option(BUILD_RACK_PLUGIN "Build a VCV Rack plugin" OFF)

message(STATUS "AirwinRackAdapter for Rack Build Process" )
message(STATUS "Installing into '${CMAKE_INSTALL_PREFIX}'")

include(src/autogen_airwin/CMakeLists.txt)
add_compile_options(-fvisibility=hidden -fvisibility-inlines-hidden)

target_include_directories(${RACK_PLUGIN_LIB} PRIVATE src src/autogen_airwin/)
target_sources(${RACK_PLUGIN_LIB} PRIVATE
src/Airwin2Rack.cpp
if(NOT MSVC)
message(STATUS "Adding clang/gcc visibility options")
add_compile_options(-fvisibility=hidden -fvisibility-inlines-hidden)
endif()

add_library(airwin-registry STATIC
src/AirwinRegistry.cpp
src/Module.cpp
src/airwin2rackbase.cpp

${AIRWIN_SOURCES}
)
${AIRWIN_SOURCES})

target_compile_definitions(airwin-registry PRIVATE _USE_MATH_DEFINES)

if (NOT MSVC)
# consistent even in warnings that chris is
target_compile_options(airwin-registry PRIVATE
-Wno-unused-function
-Wno-unused-value
-Wno-unused-but-set-variable
-Wno-multichar
)
endif()
target_include_directories(airwin-registry PUBLIC src)

if (${BUILD_RACK_PLUGIN})
set(PLUGIN_NAME ${PROJECT_NAME})
set(ADDITIONAL_PLUGIN_DISTRIBUTABLES res LICENSE.md README.md)
include(RackSDK.cmake)

add_subdirectory(libs/sst-rackhelpers)

target_include_directories(${RACK_PLUGIN_LIB} PRIVATE src src/autogen_airwin/)
target_sources(${RACK_PLUGIN_LIB} PRIVATE
src/Airwin2Rack.cpp
src/Module.cpp
)

target_compile_options(${RACK_PLUGIN_LIB} PUBLIC -Wno-suggest-override -Wno-multichar -Wno-unused-value -Wno-unused-but-set-variable -Wno-unused-variable )
target_link_libraries(${RACK_PLUGIN_LIB} PUBLIC sst-rackhelpers)
target_compile_options(${RACK_PLUGIN_LIB} PUBLIC -Wno-suggest-override -Wno-multichar -Wno-unused-value -Wno-unused-but-set-variable -Wno-unused-variable )
target_link_libraries(${RACK_PLUGIN_LIB} PUBLIC sst-rackhelpers airwin-registry)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${RACK_PLUGIN_LIB} PUBLIC -Wno-stringop-truncation)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(${RACK_PLUGIN_LIB} PUBLIC -Wno-stringop-truncation)
endif()
endif()

if (${BUILD_JUCE_PLUGIN})

file(GLOB AWCON_RESOURCES_GLOB
res/*.ttf
res/clipper.svg
res/awpdoc/*.txt
)
include(cmake/CmakeRC.cmake)
cmrc_add_resource_library(awconsolidated_resources ${AWCON_RESOURCES_GLOB})

add_subdirectory(src-juce)
endif()
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $(shell touch $(RACK_PLUGIN))
DEPS += $(cmake_rack_plugin)

$(cmake_rack_plugin): CMakeLists.txt
$(CMAKE) -B $(CMAKE_BUILD) -DRACK_SDK_DIR=$(RACK_DIR) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(CMAKE_BUILD)/dist $(EXTRA_CMAKE)
$(CMAKE) -B $(CMAKE_BUILD) -DRACK_SDK_DIR=$(RACK_DIR) -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(CMAKE_BUILD)/dist -DBUILD_RACK_PLUGIN=TRUE $(EXTRA_CMAKE)
cmake --build $(CMAKE_BUILD) -- -j $(shell getconf _NPROCESSORS_ONLN)
cmake --install $(CMAKE_BUILD)

Expand Down
47 changes: 39 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
# All the Airwindows
# All the Airwindows Consolidated

It's all the [airwindows](https://www.airwindows.com/) in a single
module for [VCV Rack](https://www.vcvrack.com/) coded in collaboration
with the [Surge Synth Team](https://surge-synthesizer.github.io).
It's all the [airwindows](https://www.airwindows.co) presented in three lovely flavors

1. As a static library with a uniform registry and access pattern for you to use
as a submodule to expose the airwindows
2. As module for [VCV Rack](https://www.vcvrack.com/) coded in collaboration, and
3. As a CLAP/VST3/AU/LV2/Standaloen JUCE plugin

Have fun!

## Notes on building
## The Library Version

The target `airwin-registry` builds a static library for you containing
all of the airwindows under a uniform api. Documenting this is still a
todo, but if you link this target, it will automatically populate the
datastructures so`AirwinRegistry.h` does what you would expect, which is
give you a map to create `airwin2rackbase` operator objects.

Have a question? Open an issue!

## The Rack Plugin

We are using @qno's excellent cmake SDK. This means the makefile works
like any other rack project.
like any other rack project.

But if you pull and want to clean build, make sure to run both the `clean` and `cleandep`
targets to rebuild fully.

## The JUCE plugin

```bask
cmake -Bignore/daw-plugin -DBUILD_JUCE_PLUGIN=TRUE -DCMAKE_BUILD_TYPE=Release
cmake --build ignore/daw-plugin --target awcons-products
```

## Updating the airwindows sub-library

To update the airwindows library
Expand All @@ -33,8 +53,19 @@ RACK_DIR=(path-to-sdk) make -j install

## Licensing

This is MIT licensed, like Airwin, but the combined work with rack is of course
GPL3 as distributed here.
## A note on licensing

Airwindows is MIT licensed and the source code here is also. But using the
GPL3 JUCE and VST3 tier results in a combined work licensed under GPL3, and
similarly the Rack plugin has a VST3 dependency

We made this library MIT so that you can build *just* the static library
and use the code in your MIT or closed source project, though.

Still unsure what you can use in a closed source environment? The answer
is basicaly `AirwinRegistry.h` and its dependencies, the cmake target
`airwin-registry` and the documentation in `res/awdoc`. Still stil unsure?
Open an issue and ask!

The clipper airwindows graphic is freely distributed by airwindows

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.38.6)
set(CPM_HASH_SUM "11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07")

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})
Loading

0 comments on commit 6158d03

Please sign in to comment.