From 95c96ac9fff2181993f276fc07eb983efb695941 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 16:08:24 +0200 Subject: [PATCH 1/6] Update Cmake version requirement --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cdaa692..86e2d081 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ -# 3.21 is bundled in VSCode 2022 -# https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes -# 3.21 is also bundled in CLion as of 2021.3 -cmake_minimum_required(VERSION 3.21) +# 3.24.1 is bundled in Visual Studio 2022 v17.4 +# 3.24.1 is also bundled in CLion as of 2023 +cmake_minimum_required(VERSION 3.24.1) # Change this to the name of your plugin # This cannot have spaces (but PRODUCT_NAME can) From ce7a60fb247568aeffa5f6ecee62e290a0d7b118 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 17:05:21 +0200 Subject: [PATCH 2/6] Cleanup: Delete deployment target comments --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e2d081..35496644 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,6 @@ project(${PROJECT_NAME} VERSION ${CURRENT_VERSION}) # By default we don't want Xcode schemes to be made for modules, etc set(CMAKE_XCODE_GENERATE_SCHEME OFF) -# Enable to build universal binaries on macOS, increasing build time -# This only affects local builds, GitHub actions always builds Universals -# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Support macOS down to High Sierra") # Adds all the module sources so they appear correctly in the IDE From df4aeb76266d4d384ab62c95ba168b708567dbc5 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 16:17:39 +0200 Subject: [PATCH 3/6] Move deployment target above project declaration I don't know why, but Pamplejuce history has this change with a commit message stating that it fixes the setting of deployment target. Will take it on faith. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35496644..15e600fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ set(PROJECT_NAME "Valentine") # Valid formats: AAX Unity VST AU AUv3 Standalone set(FORMATS AU VST3 Standalone) +# This must be set before the project() call +# see: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html +set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Support macOS down to High Sierra") + # Reads in VERSION file and sticks in it CURRENT_VERSION variable # Be sure the file has no newlines file(STRINGS VERSION CURRENT_VERSION) @@ -20,8 +24,6 @@ project(${PROJECT_NAME} VERSION ${CURRENT_VERSION}) # By default we don't want Xcode schemes to be made for modules, etc set(CMAKE_XCODE_GENERATE_SCHEME OFF) -set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Support macOS down to High Sierra") - # Adds all the module sources so they appear correctly in the IDE # Must be set before JUCE is added as a sub-dir (or any targets are made) # https://github.com/juce-framework/JUCE/commit/6b1b4cf7f6b1008db44411f2c8887d71a3348889 From c10646616cfa0c773145982fedf8ae4d53ec5436 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 16:33:06 +0200 Subject: [PATCH 4/6] Bump Catch to 3.3.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15e600fb..f98274e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,7 +224,7 @@ FetchContent_Declare( GIT_REPOSITORY https://github.com/catchorg/Catch2.git GIT_PROGRESS TRUE GIT_SHALLOW TRUE - GIT_TAG v3.1.0) + GIT_TAG v3.3.2) FetchContent_MakeAvailable(Catch2) # find_package equivalent # Setup the test executable, again C++ 20 please From cd167cc293d6f3ce00cbf03a12484502ac5e11d6 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 16:42:56 +0200 Subject: [PATCH 5/6] Don't directly link to JUCE in tests This can caulse ODR violations. Instead, expose the JUCE targets include directories and compile definitions. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f98274e5..e5b9fa72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,13 @@ target_include_directories(Tests "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/libs") -target_link_libraries(Tests PRIVATE Catch2::Catch2WithMain "${PROJECT_NAME}" ${JUCE_DEPENDENCIES}) +target_link_libraries(Tests PRIVATE Catch2::Catch2WithMain "${PROJECT_NAME}") + +# We can't link again to the shared juce target without ODR violations +# However, we can steal its include dirs and compile definitions to use in tests! +# https://forum.juce.com/t/windows-linker-issue-on-develop/55524/2 +target_compile_definitions(Tests PRIVATE $) +target_include_directories(Tests PRIVATE $) # Make an Xcode Scheme for the test executable so we can run tests in the IDE set_target_properties(Tests PROPERTIES XCODE_GENERATE_SCHEME ON) From 4066ace003d3488cf4f70c113388f6814acc6a0a Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sun, 16 Jul 2023 17:16:21 +0200 Subject: [PATCH 6/6] Cleanup: Minor formatting --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5b9fa72..1cdfd353 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,8 +188,6 @@ target_compile_definitions("${PROJECT_NAME}" JUCE_MODAL_LOOPS_PERMITTED=1 ) - - target_include_directories("${PROJECT_NAME}" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src"