summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--cmake/mason.cmake33
2 files changed, 30 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index eeec31354f..3eadbe04a4 100644
--- a/Makefile
+++ b/Makefile
@@ -212,8 +212,7 @@ $(IOS_PROJ_PATH): $(IOS_USER_DATA_PATH)/WorkspaceSettings.xcsettings $(BUILD_DEP
(cd $(IOS_OUTPUT_PATH) && cmake -G Xcode ../.. \
-DCMAKE_TOOLCHAIN_FILE=../../platform/ios/toolchain.cmake \
-DMBGL_PLATFORM=ios \
- -DMASON_PLATFORM=ios \
- -DMASON_PLATFORM_VERSION=8.0)
+ -DMASON_PLATFORM=ios)
$(IOS_USER_DATA_PATH)/WorkspaceSettings.xcsettings: platform/ios/WorkspaceSettings.xcsettings
mkdir -p "$(IOS_USER_DATA_PATH)"
@@ -513,8 +512,7 @@ $(MBGL_ANDROID_BUILD_DIR)/build.ninja: $(MBGL_ANDROID_BUILD_DIR)/env.sh platform
-DCMAKE_BUILD_TYPE=$(BUILDTYPE) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DMBGL_PLATFORM=android \
- -DMASON_PLATFORM=android \
- -DMASON_PLATFORM_VERSION=$1-$3) && \
+ -DMASON_PLATFORM=android) && \
$$$${CMAKE} \
-H. \
-B"$(MBGL_ANDROID_BUILD_DIR)"
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()