forked from Akaflieg-Freiburg/enroute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildscript-android-debug.sh
executable file
·79 lines (64 loc) · 2.19 KB
/
buildscript-android-debug.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#
# This script builds "enroute flight navigation" for Android in debug mode.
#
# See https://github.com/Akaflieg-Freiburg/enroute/wiki/Build-scripts
#
#
# Copyright © 2020 Stefan Kebekus <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Fail on first error
#
set -e
#
# Clean up
#
rm -rf build-android-debug
mkdir -p build-android-debug
cd build-android-debug
#
# Configure
#
cmake .. \
-G Ninja\
-DANDROID_ABI:STRING=armeabi-v7a \
-DANDROID_BUILD_ABI_arm64-v8a:BOOL=OFF \
-DANDROID_BUILD_ABI_armeabi-v7a:BOOL=ON \
-DANDROID_BUILD_ABI_x86:BOOL=ON \
-DANDROID_BUILD_ABI_x86_64:BOOL=OFF \
-DANDROID_NATIVE_API_LEVEL:STRING=21 \
-DANDROID_NDK:PATH=$ANDROID_NDK_ROOT \
-DANDROID_SDK:PATH=$ANDROID_SDK_ROOT \
-DANDROID_STL:STRING=c++_shared \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_COMPILER:STRING=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ \
-DCMAKE_CXX_FLAGS="-Wall -Wextra" \
-DCMAKE_C_COMPILER:STRING=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang \
-DCMAKE_FIND_ROOT_PATH:STRING=$Qt5_DIR_ANDROID \
-DCMAKE_PREFIX_PATH:STRING=$Qt5_DIR_ANDROID \
-DCMAKE_TOOLCHAIN_FILE:PATH=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DCMAKE_UNITY_BUILD:BOOL=ON
# This is bizarrely necessary, or else 'android_deployment_settings.json'
# will lack our custom AndroidManifest and the SSL libraries
cmake ..
#
# Build the executable
#
ninja
echo "Build APK"
ninja apk