summaryrefslogtreecommitdiff
path: root/cmake/mason.cmake
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-03-10 10:40:16 -0800
committerKonstantin Käfer <mail@kkaefer.com>2017-03-17 14:25:37 +0100
commitaed3869cfaf0f590f58265e203dd7b9a2ee38fb7 (patch)
treed770c9136697c8ef55a2dd44ba8905a60a6f9791 /cmake/mason.cmake
parent6379cb0cd78a47697b90211df767750847369f8e (diff)
downloadqtlocation-mapboxgl-aed3869cfaf0f590f58265e203dd7b9a2ee38fb7.tar.gz
[build] move ABI version awareness to mason.cmake
Diffstat (limited to 'cmake/mason.cmake')
-rw-r--r--cmake/mason.cmake33
1 files changed, 28 insertions, 5 deletions
diff --git a/cmake/mason.cmake b/cmake/mason.cmake
index 4e4e46b619..bc31feeb5f 100644
--- a/cmake/mason.cmake
+++ b/cmake/mason.cmake
@@ -21,11 +21,34 @@ function(mason_detect_platform)
# Determine platform version string
if(NOT MASON_PLATFORM_VERSION)
- execute_process(
- COMMAND uname -m
- OUTPUT_VARIABLE MASON_PLATFORM_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(MASON_PLATFORM_VERSION "${MASON_PLATFORM_VERSION}" PARENT_SCOPE)
+ # Android Studio only passes ANDROID_ABI, but we need to adjust that to the Mason
+ if(MASON_PLATFORM STREQUAL "android" AND NOT MASON_PLATFORM_VERSION)
+ if (ANDROID_ABI STREQUAL "armeabi")
+ set(MASON_PLATFORM_VERSION "arm-v5-9" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "armeabi-v7a")
+ set(MASON_PLATFORM_VERSION "arm-v7-9" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "arm64-v8a")
+ set(MASON_PLATFORM_VERSION "arm-v8-21" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "x86")
+ set(MASON_PLATFORM_VERSION "x86-9" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "x86_64")
+ set(MASON_PLATFORM_VERSION "x86-64-21" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "mips")
+ set(MASON_PLATFORM_VERSION "mips-9" PARENT_SCOPE)
+ elseif (ANDROID_ABI STREQUAL "mips64")
+ set(MASON_PLATFORM_VERSION "mips-64-9" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Unknown ANDROID_ABI '${ANDROID_ABI}'.")
+ endif()
+ elseif(MASON_PLATFORM STREQUAL "ios")
+ set(MASON_PLATFORM_VERSION "8.0" PARENT_SCOPE)
+ else()
+ execute_process(
+ COMMAND uname -m
+ OUTPUT_VARIABLE MASON_PLATFORM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(MASON_PLATFORM_VERSION "${MASON_PLATFORM_VERSION}" PARENT_SCOPE)
+ endif()
endif()
endfunction()