summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-08 13:26:23 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-02-08 19:07:16 +0100
commitbb931505c5f11c21a31cdd7be6fe036ca44e729d (patch)
treee0310f3a4965dbe364639efb610d96eeca49ee19 /platform/android
parentf5b86c0f11bc921647d1f677b62a14527bfb50c3 (diff)
downloadqtlocation-mapboxgl-bb931505c5f11c21a31cdd7be6fe036ca44e729d.tar.gz
[build] Remove Mason submodule in favor of CMake mason
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/config.cmake11
-rwxr-xr-xplatform/android/scripts/debug.sh24
-rwxr-xr-xplatform/android/scripts/toolchain.sh23
3 files changed, 14 insertions, 44 deletions
diff --git a/platform/android/config.cmake b/platform/android/config.cmake
index 9d8858ac0d..cfd6a3cdb5 100644
--- a/platform/android/config.cmake
+++ b/platform/android/config.cmake
@@ -2,9 +2,6 @@ add_definitions(-DMBGL_USE_GLES2=1)
include(cmake/test-files.cmake)
-#Include to use build specific variables
-include(${CMAKE_CURRENT_BINARY_DIR}/toolchain.cmake)
-
# Build thin archives.
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cruT <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cruT <TARGET> <LINK_FLAGS> <OBJECTS>")
@@ -18,17 +15,17 @@ if ((ANDROID_ABI STREQUAL "armeabi") OR (ANDROID_ABI STREQUAL "armeabi-v7a") OR
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=gold -Wl,--icf=safe ${CMAKE_SHARED_LINKER_FLAGS}")
endif()
-mason_use(jni.hpp VERSION 2.0.0 HEADER_ONLY)
+mason_use(jni.hpp VERSION 2.0.0-1 HEADER_ONLY)
mason_use(libzip VERSION 1.1.3)
mason_use(nunicode VERSION 1.7.1)
mason_use(sqlite VERSION 3.14.2)
-mason_use(gtest VERSION 1.7.0)
+mason_use(gtest VERSION 1.8.0)
mason_use(icu VERSION 58.1)
set(ANDROID_SDK_PROJECT_DIR ${CMAKE_SOURCE_DIR}/platform/android/MapboxGLAndroidSDK)
-set(ANDROID_JNI_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/jniLibs/${ANDROID_JNIDIR})
+set(ANDROID_JNI_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/jniLibs/${ANDROID_ABI})
set(ANDROID_ASSETS_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/assets)
-set(ANDROID_TEST_APP_JNI_TARGET_DIR ${CMAKE_SOURCE_DIR}/platform/android/MapboxGLAndroidSDKTestApp/src/main/jniLibs/${ANDROID_JNIDIR})
+set(ANDROID_TEST_APP_JNI_TARGET_DIR ${CMAKE_SOURCE_DIR}/platform/android/MapboxGLAndroidSDKTestApp/src/main/jniLibs/${ANDROID_ABI})
## mbgl core ##
diff --git a/platform/android/scripts/debug.sh b/platform/android/scripts/debug.sh
index efed96969a..c3390b4ce1 100755
--- a/platform/android/scripts/debug.sh
+++ b/platform/android/scripts/debug.sh
@@ -5,13 +5,12 @@ set -o pipefail
# Automation of https://github.com/mapbox/mapbox-gl-native/wiki/Android-debugging-with-remote-GDB
-export MASON_DIR="`pwd`/.mason"
-export PATH="${MASON_DIR}:${PATH}"
-
-export MASON_ANDROID_ABI=x86
export MASON_ANDROID_ARCH=x86
export MASON_ANDROID_PLATFORM=9
-export MASON_NDK_PACKAGE_VERSION=${MASON_ANDROID_ARCH}-${MASON_ANDROID_PLATFORM}-r12b
+export MASON_ANDROID_NDK_VERSION=r13b
+
+export MASON_XC_ROOT=`scripts/mason.sh PREFIX android-ndk VERSION ${MASON_ANDROID_ARCH}-${MASON_ANDROID_PLATFORM}-${MASON_ANDROID_NDK_VERSION}`
+source ${MASON_XC_ROOT}/toolchain.sh
if [[ $1 == '--prepare' ]]; then
mkdir -p ~/.android/debugging/{vendor,system}_lib
@@ -21,16 +20,16 @@ if [[ $1 == '--prepare' ]]; then
adb pull /system/bin/app_process32 ~/.android/debugging
adb pull /system/bin/linker ~/.android/debugging
- if [[ ${MASON_ANDROID_ABI} == 'x86_64' || ${MASON_ANDROID_ABI} == 'mips64' ]]; then
+ if [[ ${MASON_ANDROID_ARCH} == 'arm-v8' || ${MASON_ANDROID_ARCH} == 'x86-64' || ${MASON_ANDROID_ARCH} == 'mips-64' ]]; then
adb pull /system/bin/app_process64 ~/.android/debugging
adb pull /system/bin/linker64 ~/.android/debugging
fi
- cp `mason prefix android-ndk ${MASON_NDK_PACKAGE_VERSION}`/prebuilt/android-${MASON_ANDROID_ABI}/gdbserver/gdbserver \
- platform/android/MapboxGLAndroidSDK/src/main/jniLibs/${MASON_ANDROID_ABI}/gdbserver.so
+ cp ${MASON_XC_ROOT}/prebuilt/gdbserver/gdbserver \
+ platform/android/MapboxGLAndroidSDK/src/main/jniLibs/${ANDROID_ABI}/gdbserver.so
fi
-adb install -rtdg platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug.apk
+adb install -r -t -d -g platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug.apk
adb shell am start -n "com.mapbox.mapboxsdk.testapp/com.mapbox.mapboxsdk.testapp.activity.FeatureOverviewActivity" \
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
@@ -38,9 +37,6 @@ adb forward tcp:5039 tcp:5039
adb shell run-as com.mapbox.mapboxsdk.testapp '/data/data/com.mapbox.mapboxsdk.testapp/lib/gdbserver.so \
--attach :5039 `pgrep com.mapbox.mapboxsdk.testapp`' &
-export MASON_PLATFORM=android
-export PATH=`mason env PATH`
-`mason env MASON_ANDROID_TOOLCHAIN`-gdb \
+${MASON_XC_ROOT}/bin/gdb \
-ex "target remote :5039" \
- -ex "set solib-search-path ~/.android/debugging:~/.android/debugging/system_lib:~/.android/debugging/vendor_lib:~/.android/debugging/vendor_lib/egl:./build/android-${MASON_ANDROID_ABI}/Debug/lib.target/"
-
+ -ex "set solib-search-path ~/.android/debugging:~/.android/debugging/system_lib:~/.android/debugging/vendor_lib:~/.android/debugging/vendor_lib/egl:./build/android-${MASON_ANDROID_ARCH}-${MASON_ANDROID_PLATFORM}/Debug/lib.target/"
diff --git a/platform/android/scripts/toolchain.sh b/platform/android/scripts/toolchain.sh
deleted file mode 100755
index a64818dd20..0000000000
--- a/platform/android/scripts/toolchain.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-set -o pipefail
-
-export MASON_PLATFORM=android
-export MASON_ANDROID_ABI=${1:-arm-v7}
-export PATH="`pwd`/.mason:${PATH}"
-export MASON_DIR="`pwd`/.mason"
-
-export PATH=`mason env PATH`
-
-echo "set(CMAKE_SYSTEM_NAME Android)"
-echo "set(CMAKE_SYSTEM_VERSION 1)"
-echo "set(CMAKE_CXX_COMPILER \"`which $(mason env CXX)`\")"
-echo "set(CMAKE_C_COMPILER \"`which $(mason env CC)`\")"
-echo "set(ANDROID_JNIDIR \"`mason env JNIDIR`\")"
-echo "set(ANDROID_ABI \"\${ANDROID_JNIDIR}\")"
-echo "set(CMAKE_EXE_LINKER_FLAGS \"`mason env LDFLAGS` \${CMAKE_EXE_LINKER_FLAGS}\")"
-echo "set(CMAKE_SHARED_LINKER_FLAGS \"`mason env LDFLAGS` \${CMAKE_SHARED_LINKER_FLAGS}\")"
-echo "set(CMAKE_CXX_FLAGS \"`mason env CXXFLAGS` \${CMAKE_CXX_FLAGS}\")"
-echo "set(CMAKE_C_FLAGS \"`mason env CPPFLAGS` \${CMAKE_C_FLAGS}\")"
-echo "set(STRIP_COMMAND \"`which $(mason env STRIP)`\")"