adapt build script for M1/M2 hosts (#2433)

* adapt build script for M1/M2 hosts

* GUI way to set up build environment, update NDK information

* more precice warning message
This commit is contained in:
bjoern 2022-12-04 02:01:04 +01:00 committed by GitHub
parent d1b3124ab0
commit f2e1503b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 12 deletions

View file

@ -46,6 +46,13 @@ echo Setting CARGO_TARGET environment variables.
if test -z "$NDK_HOST_TAG"; then
KERNEL="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
if test "$ARCH" == "arm64" && ! test -f "$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$KERNEL-$ARCH/bin/aarch64-linux-android21-clang"; then
echo "arm64 host is not supported by $ANDROID_NDK_ROOT; trying to use x86_64, in case the host has a binary translation such as Rosetta or QEMU installed."
echo "(Newer NDK may support arm64 host but may lack support for Android4/ABI16)"
ARCH="x86_64"
fi
NDK_HOST_TAG="$KERNEL-$ARCH"
fi