use x86-64 ndk toolchain on arm64 darwin hosts, fixes #175
This commit is contained in:
parent
fb0a2105a0
commit
d0ddcaf4df
|
@ -296,7 +296,11 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then
|
||||||
|
|
||||||
# BUILD NATIVE LIBRARY
|
# BUILD NATIVE LIBRARY
|
||||||
if [[ ${SKIP_ffmpeg_kit} -ne 1 ]]; then
|
if [[ ${SKIP_ffmpeg_kit} -ne 1 ]]; then
|
||||||
"${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1
|
if [ "$(is_darwin_arm64)" == "1" ]; then
|
||||||
|
arch -x86_64 "${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1
|
||||||
|
else
|
||||||
|
"${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "ok"
|
echo "ok"
|
||||||
|
|
|
@ -109,6 +109,17 @@ get_clang_host() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_darwin_arm64() {
|
||||||
|
HOST_OS=$(uname -s)
|
||||||
|
HOST_ARCH=$(uname -m)
|
||||||
|
|
||||||
|
if [ "${HOST_OS}" == "Darwin" ] && [ "${HOST_ARCH}" == "arm64" ]; then
|
||||||
|
echo "1"
|
||||||
|
else
|
||||||
|
echo "0"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_toolchain() {
|
get_toolchain() {
|
||||||
HOST_OS=$(uname -s)
|
HOST_OS=$(uname -s)
|
||||||
case ${HOST_OS} in
|
case ${HOST_OS} in
|
||||||
|
@ -124,6 +135,12 @@ get_toolchain() {
|
||||||
x86_64 | amd64) HOST_ARCH=x86_64 ;;
|
x86_64 | amd64) HOST_ARCH=x86_64 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$(is_darwin_arm64)" == "1" ]; then
|
||||||
|
# NDK DOESNT HAVE AN ARM64 TOOLCHAIN ON DARWIN
|
||||||
|
# WE USE x86-64 WITH ROSETTA INSTEAD
|
||||||
|
HOST_ARCH=x86_64
|
||||||
|
fi
|
||||||
|
|
||||||
echo "${HOST_OS}-${HOST_ARCH}"
|
echo "${HOST_OS}-${HOST_ARCH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user