[FIX] Allow usage of a different NDK location for JDK 8

This allows users to not need to download the NDK multiple times if they already have it installed.

TODO: Rewrite literally all of these scripts and rebranch.
This commit is contained in:
Eva Isabella Luna 2025-06-28 17:53:07 -06:00 committed by GitHub
parent bba4fdbd01
commit a23217a8f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View File

@ -5,8 +5,12 @@ set -e
export JDK_DEBUG_LEVEL=release
if [[ "$BUILD_IOS" != "1" ]]; then
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip"
./extractndk.sh
if [[ -d $NDK ]]; then
echo "NDK already installed."
else
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux-x86_64.zip"
./extractndk.sh
fi
./maketoolchain.sh
else
chmod +x ios-arm64-clang

View File

@ -2,9 +2,13 @@
set -e
. setdevkitpath.sh
$NDK/build/tools/make-standalone-toolchain.sh \
--arch=${TARGET_SHORT} \
--platform=android-21 \
--install-dir=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
if [[ ! -f $NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain/devkit.info.${TARGET_SHORT} ]]; then
$NDK/build/tools/make-standalone-toolchain.sh \
--arch=${TARGET_SHORT} \
--platform=android-21 \
--install-dir=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
cp devkit.info.${TARGET_SHORT} $NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain/
else
echo "NDK already has android-${TARGET_SHORT}-toolchain."
fi

View File

@ -55,7 +55,9 @@ else
export JVM_PLATFORM=linux
# Set NDK
export API=21
export NDK=`pwd`/android-ndk-$NDK_VERSION
if [[ -z "$NDK" ]]; then
export NDK=`pwd`/android-ndk-$NDK_VERSION
fi
export ANDROID_NDK_ROOT=$NDK
export TOOLCHAIN=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
# export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64