commit 64cebdc106efc2de2bd30fe0ff337674bf52347b
parent fcbb5f18326d81f519a4629cc3ce8dfe83971129
Author: jatinchowdhury18 <[email protected]>
Date: Fri, 30 Apr 2021 14:34:31 -0700
Use JUCE from lv2-porting-project (#192)
* Remove old submodules
* Add new JUCE submodule
* Re-enable LV2 builds
Co-authored-by: jatinchowdhury18 <[email protected]>
Diffstat:
9 files changed, 58 insertions(+), 39 deletions(-)
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
@@ -29,7 +29,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
- sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libjack-jackd2-dev
+ sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev libjack-jackd2-dev lv2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
diff --git a/.gitmodules b/.gitmodules
@@ -1,6 +1,3 @@
-[submodule "Plugin/Juce"]
- path = Plugin/modules/DISTRHO-JUCE
- url = https://github.com/Chowdhury-DSP/DISTRHO-JUCE.git
[submodule "Plugin/foleys_gui_magic"]
path = Plugin/modules/foleys_gui_magic
url = https://github.com/jatinchowdhury18/foleys_gui_magic.git
@@ -12,4 +9,4 @@
url = https://github.com/jatinchowdhury18/RTNeural
[submodule "Plugin/modules/JUCE"]
path = Plugin/modules/JUCE
- url = https://github.com/juce-framework/JUCE
+ url = https://github.com/lv2-porting-project/JUCE
diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt
@@ -11,31 +11,37 @@ include_directories(modules/RTNeural)
# include_directories(ASIO_SDK)
if(IOS)
- juce_add_plugin(CHOWTapeModel
- COMPANY_NAME chowdsp
- PLUGIN_MANUFACTURER_CODE Chow
- PLUGIN_CODE Jdox
- FORMATS Standalone AUv3
- ProductName "CHOWTapeModel"
- ICON_BIG Source/GUI/Assets/logo.png
- MICROPHONE_PERMISSION_ENABLED TRUE
- IPHONE_SCREEN_ORIENTATIONS UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
- IPAD_SCREEN_ORIENTATIONS UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
- NEEDS_STORE_KIT TRUE
- )
+ set(JUCE_FORMATS Standalone AUv3)
else()
- juce_add_plugin(CHOWTapeModel
- COMPANY_NAME chowdsp
- PLUGIN_MANUFACTURER_CODE Chow
- PLUGIN_CODE Jdox
- FORMATS AU VST3 Standalone LV2 #VST
- ProductName "CHOWTapeModel"
- LV2_URI https://github.com/jatinchowdhury18/AnalogTapeModel
- ICON_BIG Source/GUI/Assets/logo.png
- MICROPHONE_PERMISSION_ENABLED TRUE
- )
+ set(JUCE_FORMATS AU VST3 Standalone)
endif()
+# Build LV2 only on Linux
+if(UNIX AND NOT APPLE)
+ message(STATUS "Building LV2 plugin format")
+ list(APPEND JUCE_FORMATS LV2)
+endif()
+
+# Build VST2 is SDK set
+if(TARGET juce_vst2_sdk)
+ message(STATUS "Building VST2 plugin format")
+ list(APPEND JUCE_FORMATS VST)
+endif()
+
+juce_add_plugin(CHOWTapeModel
+ COMPANY_NAME chowdsp
+ PLUGIN_MANUFACTURER_CODE Chow
+ PLUGIN_CODE Jdox
+ FORMATS ${JUCE_FORMATS}
+ ProductName "CHOWTapeModel"
+ LV2_URI https://github.com/jatinchowdhury18/AnalogTapeModel
+ ICON_BIG Source/GUI/Assets/logo.png
+ MICROPHONE_PERMISSION_ENABLED TRUE
+ IPHONE_SCREEN_ORIENTATIONS UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
+ IPAD_SCREEN_ORIENTATIONS UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight
+ NEEDS_STORE_KIT TRUE
+)
+
# create JUCE header
juce_generate_juce_header(CHOWTapeModel)
diff --git a/Plugin/modules/CMakeLists.txt b/Plugin/modules/CMakeLists.txt
@@ -1,21 +1,20 @@
-# set up JUCE and modules
-if(UNIX AND NOT APPLE)
- add_subdirectory(DISTRHO-JUCE)
-else()
- add_subdirectory(JUCE)
-endif()
+add_subdirectory(JUCE)
+include(cmake/SubprojectVersion.cmake)
+subproject_version(JUCE juce_version)
+message(STATUS "VERSION for JUCE: ${juce_version}")
+
juce_add_modules(foleys_gui_magic)
juce_add_modules(chowdsp_utils)
-include(WarningFlags.cmake)
# Using RTNeural with XSimd or Accelerate backend
if(APPLE)
- set(RTNEURAL_ACCELERATE ON CACHE BOOL "Use RTNeural with Accelerate backend" FORCE)
+set(RTNEURAL_ACCELERATE ON CACHE BOOL "Use RTNeural with Accelerate backend" FORCE)
else()
- set(RTNEURAL_XSIMD ON CACHE BOOL "Use RTNeural with XSimd backend" FORCE)
+set(RTNEURAL_XSIMD ON CACHE BOOL "Use RTNeural with XSimd backend" FORCE)
endif()
add_subdirectory(RTNeural)
+include(cmake/WarningFlags.cmake)
add_library(juce_plugin_modules STATIC)
target_link_libraries(juce_plugin_modules
PRIVATE
diff --git a/Plugin/modules/DISTRHO-JUCE b/Plugin/modules/DISTRHO-JUCE
@@ -1 +0,0 @@
-Subproject commit 5d503f334ddb849b3e13f5d7d28e553686f44f9e
diff --git a/Plugin/modules/cmake/SubprojectVersion.cmake b/Plugin/modules/cmake/SubprojectVersion.cmake
@@ -0,0 +1,20 @@
+# subproject_version(<subproject-name> <result-variable>)
+#
+# Extract version of a sub-project, which was previously included with add_subdirectory().
+function(subproject_version subproject_name VERSION_VAR)
+ # Read CMakeLists.txt for subproject and extract project() call(s) from it.
+ file(STRINGS "${${subproject_name}_SOURCE_DIR}/CMakeLists.txt" project_calls REGEX "[ \t]*project\\(")
+ # For every project() call try to extract its VERSION option
+ foreach(project_call ${project_calls})
+ string(REGEX MATCH "VERSION[ ]+([^ )]+)" version_param "${project_call}")
+ if(version_param)
+ set(version_value "${CMAKE_MATCH_1}")
+ endif()
+ endforeach()
+ if(version_value)
+ set(${VERSION_VAR} "${version_value}" PARENT_SCOPE)
+ else()
+ message("WARNING: Cannot extract version for subproject '${subproject_name}'")
+ endif()
+
+endfunction(subproject_version)
diff --git a/Plugin/modules/WarningFlags.cmake b/Plugin/modules/cmake/WarningFlags.cmake
diff --git a/mac_builds.sh b/mac_builds.sh
@@ -11,7 +11,6 @@ rm -Rf Bin/*Mac*
# set up build VST
VST_PATH=~/Developer/Plugin_SDKs/VST2_SDK/
sed -i '' "s~# juce_set_vst2_sdk_path.*~juce_set_vst2_sdk_path(${VST_PATH})~" CMakeLists.txt
-sed -i '' 's/#.*VST/VST/' CMakeLists.txt
# cmake new builds
TEAM_ID=$(more ~/Developer/mac_id)
diff --git a/win_builds.sh b/win_builds.sh
@@ -24,7 +24,6 @@ rm -Rf Bin/*Win32*
# set up VST and ASIO paths
sed -i -e "s~# juce_set_vst2_sdk_path.*~juce_set_vst2_sdk_path(C:/SDKs/VST_SDK/VST2_SDK/)~" CMakeLists.txt
# sed -i -e "s~.*ASIO_SDK.*~include_directories(C:/SDKs/ASIO_SDK/common)~" CMakeLists.txt
-sed -i -e 's/#.*VST/VST/' CMakeLists.txt
# sed -i -e 's/# JUCE_ASIO.*/JUCE_ASIO=1/' modules/CMakeLists.txt
# cmake new builds