forked from shinyquagsire23/OpenJKDF2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_android.sh
More file actions
executable file
·44 lines (34 loc) · 1.51 KB
/
build_android.sh
File metadata and controls
executable file
·44 lines (34 loc) · 1.51 KB
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
#!/bin/sh
#make flex/flex
#make byacc/yacc
export OPENJKDF2_RELEASE_COMMIT=$(git log -1 --format="%H")
export OPENJKDF2_RELEASE_COMMIT_SHORT=$(git rev-parse --short=8 HEAD)
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
NDK_TOOLCHAIN_BINS=$(dirname $(find "$ANDROID_NDK_HOME/" -name "aarch64-linux-android31-clang"))
PATH=$PATH:$NDK_TOOLCHAIN_BINS
#rm -rf build_win64
mkdir -p build_android_aarch64 && cd build_android_aarch64
OPENJKDF2_BUILD_DIR=$(pwd)
# Prevent macOS headers from getting linked in
export -n SDKROOT MACOSX_DEPLOYMENT_TARGET CPLUS_INCLUDE_PATH C_INCLUDE_PATH
(cmake .. --toolchain $(pwd)/../cmake_modules/toolchain_android_aarch64.cmake || cmake .. --toolchain $(pwd)/../cmake_modules/toolchain_android_aarch64.cmake)
if [ $? -ne 0 ]; then
exit -1
fi
make -j1 openjkdf2-armv8a
make -j1 openjkdf2-armv8a
if [ $? -ne 0 ]; then
exit -1
fi
cd ..
pushd packaging/android-project
mkdir -p app/src/main/jniLibs &&
mkdir -p app/src/main/jniLibs/arm64-v8a &&
cp $OPENJKDF2_BUILD_DIR/libopenjkdf2-armv8a.so app/src/main/jniLibs/arm64-v8a/libmain.so &&
cp $OPENJKDF2_BUILD_DIR/openal/libopenal.so app/src/main/jniLibs/arm64-v8a/libopenal.so &&
cp $OPENJKDF2_BUILD_DIR/SDL/libSDL2.so app/src/main/jniLibs/arm64-v8a/libSDL2.so &&
cp $OPENJKDF2_BUILD_DIR/SDL_mixer/libSDL2_mixer.so app/src/main/jniLibs/arm64-v8a/libSDL2_mixer.so &&
./gradlew assembleDebug &&
./gradlew installDebug &&
popd
cp $OPENJKDF2_BUILD_DIR/../packaging/android-project/app/build/outputs/apk/debug/app-debug.apk android-OpenJKDF2-arm64-v8a.apk