-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.sh
More file actions
60 lines (50 loc) · 980 Bytes
/
make.sh
File metadata and controls
60 lines (50 loc) · 980 Bytes
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
#!/bin/bash
if ! [[ $ANDROID_SDK ]]; then
echo Please setup the root path of the Android SDK
exit 1
fi
rebuild=false
arch=
while getopts ":rv" option; do
case $option in
r) rebuild=true ;;
v) arch=$OPTARG ;;
esac
done
if ! [[ $arch ]]; then
arch=arm64
fi
build_name=
target_ndk=
current_dir=$PWD
case $arch in
arm64)
build_name=android-arm64
target_ndk=arm64-v8a
;;
arm32)
build_name=android-arm32
target_ndk=armeabi-v7a
;;
x86)
build_name=android-x86
target_ndk=x86
;;
x64)
build_name=android-x64
target_ndk=x86_64
;;
*)
echo "The architecture $arch is invalid"
exit 1
;;
esac
build_dir=$current_dir/replika/build/$build_name
if $rebuild; then
rm -fr $build_dir
fi
if ! [[ -d $build_dir ]]; then
mkdir -p $build_dir
cmake -DANDROID=1 -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTARGET_ARCH=$target_ndk -DCMAKE_TOOLCHAIN_FILE="$current_dir/replika/ndktoolchain.cmake" -S "$current_dir" -B "$build_dir"
fi
ninja -C "$build_dir"