summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2016-07-22 16:05:19 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commit5f70a65a2cc33883637fcc9d13ef2c81eba9b75c (patch)
treee89486b4ca42f778603a5e19db3454c3e4278c71 /Makefile
parent795d17dbdb33186071f4ecef2fc672bf2767782a (diff)
downloadqtlocation-mapboxgl-5f70a65a2cc33883637fcc9d13ef2c81eba9b75c.tar.gz
[build] cmake android
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 69120145a7..61cbb5a912 100644
--- a/Makefile
+++ b/Makefile
@@ -367,6 +367,45 @@ test-node: node
npm test
npm run test-suite
+#### Android targets ###########################################################
+
+ANDROID_ENV = platform/android/scripts/toolchain.sh
+ANDROID_ABIS = arm-v5 arm-v7 arm-v8 x86 x86-64 mips
+
+define ANDROID_RULES
+
+build/android-$1/$(BUILDTYPE): $(BUILD_DEPS)
+ mkdir -p build/android-$1/$(BUILDTYPE)
+
+build/android-$1/$(BUILDTYPE)/toolchain.cmake: platform/android/scripts/toolchain.sh build/android-$1/$(BUILDTYPE)
+ $(ANDROID_ENV) $1 > build/android-$1/$(BUILDTYPE)/toolchain.cmake
+
+build/android-$1/$(BUILDTYPE)/Makefile: build/android-$1/$(BUILDTYPE)/toolchain.cmake platform/android/config.cmake
+ cd build/android-$1/$(BUILDTYPE) && cmake ../../.. \
+ -DCMAKE_TOOLCHAIN_FILE=build/android-$1/$(BUILDTYPE)/toolchain.cmake \
+ -DCMAKE_BUILD_TYPE=$(BUILDTYPE) \
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
+ -DMBGL_PLATFORM=android
+
+android-lib-$1: build/android-$1/$(BUILDTYPE)/Makefile
+ $(MAKE) -j$(JOBS) -C build/android-$1/$(BUILDTYPE) all
+
+android-$1: android-lib-$1
+ cd platform/android && ./gradlew --parallel --max-workers=$(JOBS) assemble$(BUILDTYPE)
+
+apackage: android-lib-$1
+endef
+
+$(foreach abi,$(ANDROID_ABIS),$(eval $(call ANDROID_RULES,$(abi))))
+
+android: android-arm-v7
+
+test-android:
+ cd platform/android && ./gradlew testReleaseUnitTest --continue
+
+apackage:
+ cd platform/android && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE)
+
#### Miscellaneous targets #####################################################
style-code: