From 12427f5ed70410b32adf7b7124f5028fea8518e2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 22 Jul 2022 15:04:38 +0100 Subject: [PATCH] Deal with homebrew cmake injecting OSX SYSROOT --- .github/workflows/build.yml | 62 ++++++++++++++++++------------------- deps/Makefile | 15 ++++----- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10d943e..12f374a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -443,22 +443,22 @@ jobs: pushd deps/PawPaw; source local.env macos; popd make features make CIBUILD=true NOOPT=true WITH_LTO=true -j $(sysctl -n hw.logicalcpu) - #- name: Build macOS intel (AU using juce) - #env: - #MACOSX_DEPLOYMENT_TARGET: '10.8' - #run: | - #pushd deps/PawPaw; source local.env macos; popd - #git clone --depth=1 -b 6.1.6 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_OSX_SYSROOT=${PAWPAW_PREFIX} -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) - #env: - #MACOS_ARCHS: 'x86_64' - #run: | - #pushd deps/PawPaw; source local.env macos; popd - #./utils/create-macos-installer.sh + - name: Build macOS intel (AU using juce) + env: + MACOSX_DEPLOYMENT_TARGET: '10.8' + run: | + pushd deps/PawPaw; source local.env macos; popd + git clone --depth=1 -b 6.1.6 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_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) -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) + env: + MACOS_ARCHS: 'x86_64' + run: | + pushd deps/PawPaw; source local.env macos; popd + ./utils/create-macos-installer.sh - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true id: slug1 @@ -533,21 +533,21 @@ jobs: pushd deps/PawPaw; source local.env macos-universal; popd make features make CIBUILD=true NOOPT=true WITH_LTO=true -j $(sysctl -n hw.logicalcpu) - #- name: Build macOS universal (AU using juce) - #env: - #MACOSX_DEPLOYMENT_TARGET: '10.12' - #run: | - #pushd deps/PawPaw; source local.env macos-universal; popd - #git clone --depth=1 -b 6.1.6 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_OSX_SYSROOT=${PAWPAW_PREFIX} -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) - #env: - #MACOS_ARCHS: 'arm64,x86_64' - #run: | - #pushd deps/PawPaw; source local.env macos-universal; popd - #./utils/create-macos-installer.sh + - name: Build macOS universal (AU using juce) + env: + MACOSX_DEPLOYMENT_TARGET: '10.12' + run: | + pushd deps/PawPaw; source local.env macos-universal; popd + git clone --depth=1 -b 6.1.6 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_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) -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) + env: + MACOS_ARCHS: 'arm64,x86_64' + run: | + pushd deps/PawPaw; source local.env macos-universal; popd + ./utils/create-macos-installer.sh - name: Set sha8 (non-release) if: startsWith(github.ref, 'refs/tags/') != true id: slug1 diff --git a/deps/Makefile b/deps/Makefile index e6f2ede..dc22214 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -111,6 +111,13 @@ CMAKE += -DCMAKE_INSTALL_LIBDIR=lib CMAKE += -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)' CMAKE += -DBUILD_SHARED_LIBS=OFF +# make sure debug/release matches +ifeq ($(DEBUG),true) +CMAKE += -DCMAKE_BUILD_TYPE=Debug +else +CMAKE += -DCMAKE_BUILD_TYPE=Release +endif + # make sure macOS target matches ours ifeq ($(MACOS),true) ifneq (,$(findstring -arch$(SPACE),$(CXXFLAGS))) @@ -124,13 +131,7 @@ 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 -ifeq ($(DEBUG),true) -CMAKE += -DCMAKE_BUILD_TYPE=Debug -else -CMAKE += -DCMAKE_BUILD_TYPE=Release +CMAKE += -DCMAKE_OSX_SYSROOT=$(shell xcrun --sdk macosx --show-sdk-path) endif # fix cross-compilation for windows