From ec7e6b231e10c441a579cee4339bc3c7a2d9b4cd Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 15 May 2022 01:16:23 +0100 Subject: [PATCH] Fail build if wrong macOS target used, fix macOS AU (missing fftw) --- .github/workflows/build.yml | 6 +++--- deps/Makefile | 7 +++++++ jucewrapper/CMakeLists.txt | 3 +++ jucewrapper/CardinalWrapper.cpp | 5 +++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0b9c41..3f5f095 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push: env: - CACHE_VERSION: 23 + CACHE_VERSION: 24 DEBIAN_FRONTEND: noninteractive HOMEBREW_NO_AUTO_UPDATE: 1 LIBGL_ALWAYS_SOFTWARE: 'true' @@ -451,7 +451,7 @@ jobs: git clone --depth=1 -b master https://github.com/juce-framework/JUCE.git jucewrapper/JUCE sed -i -e 's/kAudioUnitProperty_SupportsMPE/kAudioUnitProperty_ignore_SupportsMPE/' jucewrapper/JUCE/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h mkdir -p jucewrapper/build - pushd jucewrapper/build; cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 -DCMAKE_BUILD_TYPE=Release .. && make -j $(sysctl -n hw.logicalcpu); popd + pushd jucewrapper/build; cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/ - name: Build macOS intel (packaging) run: | @@ -539,7 +539,7 @@ jobs: pushd deps/PawPaw; source local.env macos-universal; popd git clone --depth=1 -b master https://github.com/juce-framework/JUCE.git jucewrapper/JUCE mkdir -p jucewrapper/build - pushd jucewrapper/build; cmake -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release .. && make -j $(sysctl -n hw.logicalcpu); popd + pushd jucewrapper/build; cmake -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/ - name: Build macOS universal (packaging) run: | diff --git a/deps/Makefile b/deps/Makefile index 876e2eb..94b15c1 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -99,12 +99,18 @@ CMAKE += -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)' CMAKE += -DBUILD_SHARED_LIBS=OFF # make sure macOS target matches ours +ifeq ($(MACOS),true) ifneq (,$(findstring -arch$(SPACE),$(CXXFLAGS))) CMAKE += -DCMAKE_OSX_ARCHITECTURES='$(subst $(SPACE),;,$(subst -arch=,,$(filter -arch=%,$(subst -arch$(SPACE),-arch=,$(CXXFLAGS)))))' +else ifeq ($(CIBUILD),true) +$(error CI build requires -march flag on macOS) endif ifneq (,$(findstring -mmacosx-version-min=,$(CXXFLAGS))) export MACOSX_DEPLOYMENT_TARGET = $(subst -mmacosx-version-min=,,$(filter -mmacosx-version-min=%,$(CXXFLAGS))) CMAKE += -DCMAKE_OSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET) +else ifeq ($(CIBUILD),true) +$(error CI build requires -mmacosx-version-min flag on macOS) +endif endif # make sure debug/release matches @@ -151,6 +157,7 @@ DEP_MAKE += CONFIGURE="$(CONFIGURE)" DEP_MAKE += DEP_FLAGS="$(BASE_FLAGS)" DEP_MAKE += DEP_MAC_SDK_FLAGS= DEP_MAKE += MACHINE=$(MACHINE)$(MACHINE_SUFFIX) +DEP_MAKE += VERBOSE=1 ifeq ($(MACOS),true) DEP_MAKE += SHA256SUM="shasum5.28 -a 256" diff --git a/jucewrapper/CMakeLists.txt b/jucewrapper/CMakeLists.txt index 26bd6ce..8f564a6 100644 --- a/jucewrapper/CMakeLists.txt +++ b/jucewrapper/CMakeLists.txt @@ -86,6 +86,7 @@ set_property(TARGET libzstd PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/.. # dependencies find_package(PkgConfig REQUIRED) +pkg_check_modules(FFTW3F REQUIRED fftw3f) pkg_check_modules(LIBLO REQUIRED liblo) pkg_check_modules(SNDFILE REQUIRED sndfile) @@ -181,6 +182,7 @@ target_link_libraries(CardinalFX ${GL_LIBRARIES} ${DBUS_LIBRARIES} -L${LIBLO_LIBRARY_DIRS} + ${FFTW3F_LIBRARIES} ${LIBLO_LIBRARIES} ${SNDFILE_LIBRARIES} ${X11_LIBRARIES} @@ -269,6 +271,7 @@ target_link_libraries(CardinalSynth ${GL_LIBRARIES} ${DBUS_LIBRARIES} -L${LIBLO_LIBRARY_DIRS} + ${FFTW3F_LIBRARIES} ${LIBLO_LIBRARIES} ${SNDFILE_LIBRARIES} ${X11_LIBRARIES} diff --git a/jucewrapper/CardinalWrapper.cpp b/jucewrapper/CardinalWrapper.cpp index c4da989..f0b305f 100644 --- a/jucewrapper/CardinalWrapper.cpp +++ b/jucewrapper/CardinalWrapper.cpp @@ -17,6 +17,11 @@ #include +#include +#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + #error unwanted macOS version, too new +#endif + #define createPlugin createStaticPlugin #include "src/DistrhoPluginInternal.hpp" #include "src/DistrhoUIInternal.hpp"