mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-26 23:01:04 +08:00
Problem: Android build script isn't compatible with latest NDK version (#4278)
* Problem: Android build script isn't compatible with latest NDK version Solution: Update to Android NDK r22b
This commit is contained in:
parent
7c2df78b49
commit
519e2bf129
@ -97,7 +97,12 @@ function android_build_set_env {
|
|||||||
export TOOLCHAIN_ARCH="x86_64"
|
export TOOLCHAIN_ARCH="x86_64"
|
||||||
fi
|
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}"
|
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 TOOLCHAIN="${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${HOST_PLATFORM}"
|
||||||
local CC="${TOOLCHAIN_PATH}/${TOOLCHAIN_COMP}-clang"
|
local CC="${TOOLCHAIN_PATH}/${TOOLCHAIN_COMP}-clang"
|
||||||
local CXX="${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 AS="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-as"
|
||||||
local AR="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ar"
|
local AR="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ar"
|
||||||
local RANLIB="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ranlib"
|
local RANLIB="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ranlib"
|
||||||
|
@ -35,7 +35,7 @@ esac
|
|||||||
|
|
||||||
# Set default values used in ci builds
|
# 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].
|
# With NDK r21e, the minimum SDK version range is [16, 29].
|
||||||
# SDK version 21 is the minimum version for 64-bit builds.
|
# SDK version 21 is the minimum version for 64-bit builds.
|
||||||
export MIN_SDK_VERSION=${MIN_SDK_VERSION:-21}
|
export MIN_SDK_VERSION=${MIN_SDK_VERSION:-21}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
export NDK_VERSION=android-ndk-r21e
|
export NDK_VERSION=android-ndk-r22b
|
||||||
export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}"
|
export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}"
|
||||||
|
|
||||||
case $(uname | tr '[:upper:]' '[:lower:]') in
|
case $(uname | tr '[:upper:]' '[:lower:]') in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user