-
Notifications
You must be signed in to change notification settings - Fork 4
/
axolotl-build.sh
45 lines (35 loc) · 1.07 KB
/
axolotl-build.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
#!/bin/sh
set -x
if [ ! -d "${WORKSPACE}/silentphone2" ]; then
echo '***** Variable WORKSPACE does not point to correct directory *****'
exit 1
fi
if [ "x$ANDROID_NDK" = "x" ]; then
echo '***** Variable ANDROID_NDK not set *****'
exit 1
fi
if [ "x$SC_BUILD_TYPE" = "xDEVELOP" ]; then
BUILD_TYPE=Debug
echo "*** building develop configuration"
else
BUILD_TYPE="Release"
echo "*** building release configuration"
fi
rm -rf buildAxoAndroid
mkdir buildAxoAndroid
cd buildAxoAndroid
echo "###### If AUTOMATED_BUILD is set then ignore 2 cmake errors regarding OBJECT library #####"
cmake -DANDROID=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
if make android; then
echo "Android build OK"
else
exit 1
fi
# now copy the created static libs to silentphone2 JNI directory
cp android/obj/local/armeabi-v7a/libzina.a ${WORKSPACE}/silentphone2/jni/armeabi-v7a/
# Back to main Axolotl directory
cd ..
cp protobuf/android/obj/local/armeabi-v7a/libprotobuf-cpp-lite.a ${WORKSPACE}/silentphone2/jni/armeabi-v7a/
# cleanup build directory
rm -rf buildAxoAndroid
exit 0