Skip to content

Commit 5415e16

Browse files
committed
Support Mac Arm64
1 parent 3acf42a commit 5415e16

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

library/src/main/jni/buildJNI

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ if [[ -z "$THREADS" ]] || [[ "$THREADS" -eq "0" ]]; then
8888
fi
8989

9090
if [[ -n "$NDK" ]] && [[ -f "$NDK/ndk-build" ]]; then
91-
"$NDK/ndk-build" ${BUILD_ARG} -j${THREADS}
91+
if ! "$NDK/ndk-build" ${BUILD_ARG} -j${THREADS}; then
92+
# check if using mac m1.
93+
if [[ $(uname -s) == "Darwin" ]] && uname -a | grep -i arm64; then
94+
arch -arch x86_64 "$NDK/ndk-build" ${BUILD_ARG} -j${THREADS}
95+
fi
96+
fi
9297
elif [[ -n $(command -v cmd && cmd /C set | grep -i 'NDK') ]]; then
9398
cmd /C "set CGE_USE_VIDEO_MODULE=1 && %NDK%/ndk-build.cmd" ${BUILD_ARG} -j${THREADS}
9499
else

0 commit comments

Comments
 (0)