/
configure-android
executable file
·62 lines (49 loc) · 1.23 KB
/
configure-android
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
#!/bin/bash
export MAINFOLDER=`pwd`
ABI="armeabi-v7a"
# Possible ABIs:
# armeabi
# armeabi-v6 with VFP
# armeabi-v7a
# armeabi-v7a with NEON
# armeabi-v7a with VFPV3
# x86
API_LEVEL=9 # Default is 8
# See SDK/Android/android.toolchain.cmake for a full list of options.
export OPTIONS=("$MAINFOLDER" -G "Unix Makefiles"
-DOGRE_BUILD_PLATFORM_ANDROID=1
-DOGREKIT_UNITY_BUILD=1
-DOGRE_UNITY_BUILD=1
-DOGREKIT_MINIMAL_FREEIMAGE_CODEC=1
-DOGREKIT_BUILD_ANDROID=1
-DLIBRARY_OUTPUT_PATH=
-DCMAKE_TOOLCHAIN_FILE="$MAINFOLDER/SDK/Android/android.toolchain.cmake"
-DANDROID_ABI="$ABI"
-DANDROID_NATIVE_API_LEVEL=$API_LEVEL
)
if [ "" = "$1" ];
then
echo "Use: $0 <build target directory> [ debug ]"
exit 1
fi
if [ "" = "${NDK}" ];
then
echo "NDK Path is empty."
exit 1
fi
if [ ! -d $1 ];
then
mkdir "$1"
fi
#
cd "$1" #>/dev/null 2>&1 &&
# It's necessary to run cmake twice in order to generate files needed for RTSS
if [ "debug" = "$2" ];
then
cmake "${OPTIONS[@]}" -DCMAKE_BUILD_TYPE="Debug" --debug-trycompile && \
cmake "${OPTIONS[@]}" -DCMAKE_BUILD_TYPE="Debug" --debug-trycompile
else
cmake "${OPTIONS[@]}" -DCMAKE_BUILD_TYPE="MinSizeRel" && \
cmake "${OPTIONS[@]}" -DCMAKE_BUILD_TYPE="MinSizeRel"
fi
# make