diff --git a/builds/android/android_build_helper.sh b/builds/android/android_build_helper.sh index 7370fbea..81c2557a 100644 --- a/builds/android/android_build_helper.sh +++ b/builds/android/android_build_helper.sh @@ -97,7 +97,12 @@ function android_build_set_env { export TOOLCHAIN_ARCH="x86_64" fi - export ANDROID_BUILD_SYSROOT="${ANDROID_NDK_ROOT}/platforms/android-${MIN_SDK_VERSION}/arch-${TOOLCHAIN_ARCH}" + # Since NDK r22 the "platforms" dir got removed + if [ -d "${ANDROID_NDK_ROOT}/platforms" ]; then + export ANDROID_BUILD_SYSROOT="${ANDROID_NDK_ROOT}/platforms/android-${MIN_SDK_VERSION}/arch-${TOOLCHAIN_ARCH}" + else + export ANDROID_BUILD_SYSROOT="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${HOST_PLATFORM}/sysroot" + fi export ANDROID_BUILD_PREFIX="${ANDROID_BUILD_DIR}/prefix/${TOOLCHAIN_ARCH}" } @@ -170,7 +175,12 @@ function _android_build_opts_process_binaries { local TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${HOST_PLATFORM}" local CC="${TOOLCHAIN_PATH}/${TOOLCHAIN_COMP}-clang" local CXX="${TOOLCHAIN_PATH}/${TOOLCHAIN_COMP}-clang++" - local LD="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ld" + # Since NDK r22 the "platforms" dir got removed and the default linker is LLD + if [ -d "${ANDROID_NDK_ROOT}/platforms" ]; then + local LD="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ld" + else + local LD="${TOOLCHAIN_PATH}/ld" + fi local AS="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-as" local AR="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ar" local RANLIB="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ranlib" diff --git a/builds/android/build.sh b/builds/android/build.sh index d6ea8c3e..ba4201d0 100755 --- a/builds/android/build.sh +++ b/builds/android/build.sh @@ -35,7 +35,7 @@ esac # Set default values used in ci builds -export NDK_VERSION=${NDK_VERSION:-android-ndk-r21e} +export NDK_VERSION=${NDK_VERSION:-android-ndk-r22b} # With NDK r21e, the minimum SDK version range is [16, 29]. # SDK version 21 is the minimum version for 64-bit builds. export MIN_SDK_VERSION=${MIN_SDK_VERSION:-21} diff --git a/builds/android/ci_build.sh b/builds/android/ci_build.sh index 1eaa7de2..1ffa771d 100755 --- a/builds/android/ci_build.sh +++ b/builds/android/ci_build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export NDK_VERSION=android-ndk-r21e +export NDK_VERSION=android-ndk-r22b export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}" case $(uname | tr '[:upper:]' '[:lower:]') in