1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

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.
This commit is contained in:
Anthony Bilinski 2022-03-03 02:46:31 -08:00
parent ad862ca50e
commit b4636c8174
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -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}"