-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmake_android.sh
More file actions
33 lines (28 loc) · 985 Bytes
/
make_android.sh
File metadata and controls
33 lines (28 loc) · 985 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
#!/bin/sh
if [ -n "$ANDROID_NDK" ]; then
export NDK=${ANDROID_NDK}
elif [ -n "$ANDROID_NDK_HOME" ]; then
export NDK=${ANDROID_NDK_HOME}
else
export NDK=~/android-ndk-r15c
fi
if [ ! -d "$NDK" ]; then
echo "Please set ANDROID_NDK environment to the root of NDK."
exit 1
fi
function build() {
API=$1
ABI=$2
TOOLCHAIN_ANME=$3
BUILD_PATH=build.Android.${ABI}
cmake -H. -B${BUILD_PATH} -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/android.toolchain.cmake \
-DANDROID_NATIVE_API_LEVEL=${API} -DANDROID_TOOLCHAIN=clang \
-DANDROID_TOOLCHAIN_NAME=${TOOLCHAIN_ANME}
cmake --build ${BUILD_PATH} --config Release
mkdir -p plugin/Plugins/Android/libs/${ABI}/
cp ${BUILD_PATH}/libzstd.so plugin/Plugins/Android/libs/${ABI}/libzstd.so
mkdir -p Assets/Plugins/Android/libs/${ABI}/
cp ${BUILD_PATH}/libzstd.so Assets/Plugins/Android/libs/${ABI}/libzstd.so
}
build android-16 armeabi-v7a arm-linux-androideabi-4.9
build android-16 arm64-v8a aarch64-linux-android-4.9