summaryrefslogtreecommitdiff
path: root/platform/android/config.cmake
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-20 19:24:21 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-02-22 18:06:20 +0100
commit341e65f7d51e7acc0bf73893317251adc4d23cb6 (patch)
treecd549c3a57e7dc7737efa7c89298a7ea7777b900 /platform/android/config.cmake
parent586ae94ec4cfd3ea5b223ba36fc519ef8ada5eff (diff)
downloadqtlocation-mapboxgl-341e65f7d51e7acc0bf73893317251adc4d23cb6.tar.gz
[build] use system-provided Android NDK when available
and fall back to Mason if it isn't
Diffstat (limited to 'platform/android/config.cmake')
-rw-r--r--platform/android/config.cmake12
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/android/config.cmake b/platform/android/config.cmake
index bda2c27e78..27f538b95e 100644
--- a/platform/android/config.cmake
+++ b/platform/android/config.cmake
@@ -27,6 +27,10 @@ set(ANDROID_JNI_TARGET_DIR ${ANDROID_SDK_PROJECT_DIR}/src/main/jniLibs/${ANDROID
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_ABI})
+if (NOT DEFINED ANDROID_TOOLCHAIN_PREFIX)
+ set(ANDROID_TOOLCHAIN_PREFIX "${MASON_XC_ROOT}/bin/${ANDROID_TOOLCHAIN}-")
+endif()
+
## mbgl core ##
macro(mbgl_platform_core)
@@ -205,7 +209,7 @@ target_link_libraries(mapbox-gl
# Create a stripped version of the library and copy it to the JNIDIR.
add_custom_command(TARGET mapbox-gl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${ANDROID_JNI_TARGET_DIR}
- COMMAND ${STRIP_COMMAND} $<TARGET_FILE:mapbox-gl> -o ${ANDROID_JNI_TARGET_DIR}/$<TARGET_FILE_NAME:mapbox-gl>)
+ COMMAND ${ANDROID_TOOLCHAIN_PREFIX}strip $<TARGET_FILE:mapbox-gl> -o ${ANDROID_JNI_TARGET_DIR}/$<TARGET_FILE_NAME:mapbox-gl>)
## Test library ##
@@ -266,8 +270,8 @@ target_add_mason_package(mbgl-test PRIVATE geojsonvt)
add_custom_command(TARGET mbgl-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/stripped
- COMMAND ${STRIP_COMMAND} $<TARGET_FILE:mapbox-gl> -o ${CMAKE_CURRENT_BINARY_DIR}/stripped/$<TARGET_FILE_NAME:mapbox-gl>
- COMMAND ${STRIP_COMMAND} $<TARGET_FILE:mbgl-test> -o ${CMAKE_CURRENT_BINARY_DIR}/stripped/$<TARGET_FILE_NAME:mbgl-test>)
+ COMMAND ${ANDROID_TOOLCHAIN_PREFIX}strip $<TARGET_FILE:mapbox-gl> -o ${CMAKE_CURRENT_BINARY_DIR}/stripped/$<TARGET_FILE_NAME:mapbox-gl>
+ COMMAND ${ANDROID_TOOLCHAIN_PREFIX}strip $<TARGET_FILE:mbgl-test> -o ${CMAKE_CURRENT_BINARY_DIR}/stripped/$<TARGET_FILE_NAME:mbgl-test>)
## Custom layer example ##
@@ -289,4 +293,4 @@ target_link_libraries(example-custom-layer
add_custom_command(TARGET example-custom-layer POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${ANDROID_TEST_APP_JNI_TARGET_DIR}
- COMMAND ${STRIP_COMMAND} $<TARGET_FILE:example-custom-layer> -o ${ANDROID_TEST_APP_JNI_TARGET_DIR}/$<TARGET_FILE_NAME:example-custom-layer>)
+ COMMAND ${ANDROID_TOOLCHAIN_PREFIX}strip $<TARGET_FILE:example-custom-layer> -o ${ANDROID_TEST_APP_JNI_TARGET_DIR}/$<TARGET_FILE_NAME:example-custom-layer>)