-
Notifications
You must be signed in to change notification settings - Fork 7
/
build_android_template.bat
48 lines (36 loc) · 1.33 KB
/
build_android_template.bat
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
del /f /s /q "../build/android/*.*"
rd /s /q "../build/android"
del /f /s /q "../install/android/*.*"
rd /s /q "../install/android"
rem set ANDROID_NDK_HOME=E:/code/android/ndk/android-ndk-r21b
rem armeabi-v7a-shared
call:build armeabi-v7a-shared armeabi-v7a ON
rem armeabi-v7a-static
call:build armeabi-v7a-static armeabi-v7a OFF
rem arm64-v8a-shared
call:build arm64-v8a-shared arm64-v8a ON
rem arm64-v8a-static
call:build arm64-v8a-static arm64-v8a OFF
rem x86-shared
call:build x86-shared x86 ON
rem x86-static
call:build x86-static x86 OFF
rem x86_64-shared
call:build x86_64-shared x86_64 ON
rem x86_64-static
call:build x86_64-static x86_64 OFF
goto EOF
rem params: type(armeabi-v7a-shared) abi(armeabi-v7a) build_shared_libs(ON)
:build
cmake -G "Unix Makefiles" -S ../src -B ../build/android/%1 ^
-DCMAKE_TOOLCHAIN_FILE="%ANDROID_NDK_HOME%/build/cmake/android.toolchain.cmake" ^
-DCMAKE_MAKE_PROGRAM="%ANDROID_NDK_HOME%/prebuilt/windows-x86_64/bin/make.exe" ^
-DCMAKE_INSTALL_PREFIX=../install/android/%1 ^
-DANDROID_NDK="%ANDROID_NDK_HOME%" ^
-DANDROID_ABI=%2 ^
-DCMAKE_BUILD_TYPE=release ^
-DANDROID_PLATFORM=android-22 ^
-DBUILD_SHARED_LIBS=%3
cmake --build ../build/android/%1 --clean-first --config release --target all
cmake --install ../build/android/%1 --config release --prefix ../install/android/%1
:EOF