From 2d94807339be67419c7958412e54b1361d186481 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Thu, 18 Jul 2024 12:31:56 +0200 Subject: [PATCH] Update build-android.sh --- ci/build-android.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ci/build-android.sh b/ci/build-android.sh index 4191dcf7..a2221d5b 100755 --- a/ci/build-android.sh +++ b/ci/build-android.sh @@ -2,19 +2,14 @@ set -euxo pipefail +PROCS="" if [[ "$OS_NAME" == "osx" ]]; then - ANDROID_HOME=$HOME/Library/Android/sdk - SDKMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager - echo y | $SDKMANAGER "ndk;21.4.7075529" - ln -sfn $ANDROID_HOME/ndk/21.4.7075529 $ANDROID_HOME/ndk-bundle - $ANDROID_HOME/ndk-bundle/ndk-build -j3 -fi -if [[ "$OS_NAME" == "linux" ]]; then - ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager - echo "y" | $SDKMANAGER "ndk;21.4.7075529" - ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle - ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT - $ANDROID_HOME/ndk-bundle/ndk-build -j2 + PROCS=$(sysctl -n hw.ncpu) +else + PROCS=$(nproc) fi + +SDKMANAGER=$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager +echo y | $SDKMANAGER "ndk;21.4.7075529" +ln -sfn $ANDROID_HOME/ndk/21.4.7075529 $ANDROID_HOME/ndk-bundle +$ANDROID_HOME/ndk-bundle/ndk-build -j$PROCS