From b4636c81748044e185f9785253e2c87c30758283 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Thu, 3 Mar 2022 02:46:31 -0800 Subject: [PATCH] chore(CI): Add support for building openal for macOS CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS. MACOSX_RPATH must be set explicitly for OpenAL to be found. It is default using newer cmake, but OpenAL is using cmake 2.6. --- buildscripts/build_openal.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/buildscripts/build_openal.sh b/buildscripts/build_openal.sh index 2203b3c20..c15520639 100755 --- a/buildscripts/build_openal.sh +++ b/buildscripts/build_openal.sh @@ -10,11 +10,19 @@ readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")" source "${SCRIPT_DIR}/build_utils.sh" -parse_arch --dep "openal" --supported "win32 win64" "$@" +parse_arch --dep "openal" --supported "win32 win64 macos" "$@" "${SCRIPT_DIR}/download/download_openal.sh" -patch -p1 < "${SCRIPT_DIR}/patches/openal-cmake-3-11.patch" +if [ "${SCRIPT_ARCH}" != "macos" ]; then + patch -p1 < "${SCRIPT_DIR}/patches/openal-cmake-3-11.patch" + DDSOUND="-DDSOUND_INCLUDE_DIR=/usr/${MINGW_ARCH}-w64-mingw32/include \ + -DDSOUND_LIBRARY=/usr/${MINGW_ARCH}-w64-mingw32/lib/libdsound.a" + MACOSX_RPATH="" +else + DDSOUND="" + MACOSX_RPATH="-DCMAKE_MACOSX_RPATH=ON" +fi export CFLAGS="-fPIC" cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \ @@ -22,8 +30,9 @@ cmake "-DCMAKE_INSTALL_PREFIX=${DEP_PREFIX}" \ -DALSOFT_UTILS=OFF \ -DALSOFT_EXAMPLES=OFF \ "${CMAKE_TOOLCHAIN_FILE}" \ - -DDSOUND_INCLUDE_DIR="/usr/${MINGW_ARCH}-w64-mingw32/include" \ - -DDSOUND_LIBRARY="/usr/${MINGW_ARCH}-w64-mingw32/lib/libdsound.a" \ + "${DDSOUND}" \ + "-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOS_MINIMUM_SUPPORTED_VERSION}" \ + "${MACOSX_RPATH}" \ . make -j "${MAKE_JOBS}"