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

chore(CI): Add macOS platform detection for build scripts

This commit is contained in:
Anthony Bilinski 2022-03-06 18:54:59 -08:00
parent 90210a9826
commit 502ccb1e1b
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -6,6 +6,8 @@
set -euo pipefail
MACOS_MINIMUM_SUPPORTED_VERSION=10.15
usage()
{
# note: this is the usage from the build script's context, so the usage
@ -42,15 +44,26 @@ parse_arch()
if [ "${SCRIPT_ARCH}" == "win32" ] || [ "${SCRIPT_ARCH}" == "win64" ]; then
if [ "${SCRIPT_ARCH}" == "win32" ]; then
local ARCH="i686"
MINGW_ARCH="i686"
elif [ "${SCRIPT_ARCH}" == "win64" ]; then
local ARCH="x86_64"
MINGW_ARCH="x86_64"
fi
DEP_PREFIX='/windows/'
MINGW_ARCH="${ARCH}"
HOST_OPTION="--host=${MINGW_ARCH}-w64-mingw32"
CROSS_LDFLAG=""
CROSS_CFLAG=""
CROSS_CPPFLAG=""
MAKE_JOBS="$(nproc)"
CMAKE_TOOLCHAIN_FILE="-DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake"
elif [ "${SCRIPT_ARCH}" == "macos" ]; then
DEP_PREFIX="$(realpath $(dirname $(realpath ${BASH_SOURCE[0]}))/../local-deps)"
mkdir -p $DEP_PREFIX
HOST_OPTION=''
CROSS_LDFLAG="-mmacosx-version-min=$MACOS_MINIMUM_SUPPORTED_VERSION"
CROSS_CFLAG="-mmacosx-version-min=$MACOS_MINIMUM_SUPPORTED_VERSION"
CROSS_CPPFLAG="-mmacosx-version-min=$MACOS_MINIMUM_SUPPORTED_VERSION"
MAKE_JOBS="$(sysctl -n hw.ncpu)"
CMAKE_TOOLCHAIN_FILE=""
else
echo "Unexpected arch ${SCRIPT_ARCH}"
usage