summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-03-08 15:33:33 -0800
committerKonstantin Käfer <mail@kkaefer.com>2017-03-08 17:41:33 -0800
commitc880560f80d863189dd9e169392119e8ac04bc13 (patch)
tree1446094ed2cca6eaee47554f4ea9abab69bfd552 /platform
parente044e0aab9f63883e935d94e0cf9aceb37f4e6eb (diff)
downloadqtlocation-mapboxgl-c880560f80d863189dd9e169392119e8ac04bc13.tar.gz
[build] require Android r13b
We're trying to use a local NDK, but in case it is too old or too new, we fall back to downloading the correct version via Mason, like in the olden times.
Diffstat (limited to 'platform')
-rwxr-xr-xplatform/android/scripts/ndk.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/android/scripts/ndk.sh b/platform/android/scripts/ndk.sh
index 96a314a3c2..73e6ad0310 100755
--- a/platform/android/scripts/ndk.sh
+++ b/platform/android/scripts/ndk.sh
@@ -20,9 +20,12 @@ NDK_ANDROID_VERSION=$1-$3
ANDROID_NATIVE_API_LEVEL=$3
ANDROID_ABI=$2
+NDK_EXPECTED_VERSION_SHORT=r13b
+NDK_EXPECTED_VERSION_LONG=13.1.3345770
+
function mason_ndk {
local CMAKE=${CMAKE:-cmake}
- MASON_XC_ROOT="`${CMAKE} -P cmake/mason.cmake PREFIX android-ndk VERSION ${NDK_ANDROID_VERSION}-r13b`"
+ MASON_XC_ROOT="`${CMAKE} -P cmake/mason.cmake PREFIX android-ndk VERSION ${NDK_ANDROID_VERSION}-${NDK_EXPECTED_VERSION_SHORT}`"
local TOOLCHAIN="${MASON_XC_ROOT}/toolchain.cmake"
if [ ! -f "${TOOLCHAIN}" ]; then
@@ -64,6 +67,12 @@ function system_ndk {
return 1
fi
+ local NDK_VERSION_LONG=$(sed -n 's/^Pkg.Revision *= *//p' "${NDK_DIR}/source.properties")
+ if [ "${NDK_VERSION_LONG}" != "${NDK_EXPECTED_VERSION_LONG}" ]; then
+ warning "Android NDK version '${NDK_VERSION_LONG}' doesn't match required version '${NDK_EXPECTED_VERSION_LONG}'"
+ return 1
+ fi
+
# Try to install CMake if it's not installed yet.
mkdir -p "${SDK_DIR}/cmake"
local CMAKE_VERSION=/$(ls "${SDK_DIR}/cmake" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
@@ -93,7 +102,7 @@ function system_ndk {
return 1
fi
- info "Using system-provided Android NDK at ${NDK_DIR}"
+ info "Using system-provided Android NDK ${NDK_VERSION_LONG} at ${NDK_DIR}"
echo CMAKE=\"${CMAKE}\"
echo CMAKE_GENERATOR=\"Android Gradle - Ninja\"
echo CMAKE_ARGS=\" \