forked from neoml-lib/neoml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_android.cmd
57 lines (46 loc) · 2.08 KB
/
build_android.cmd
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
@echo off
SETLOCAL EnableDelayedExpansion
set FINE_CMAKE_NDK_ROOT=C:\android-ndk-r23
set FINE_CMAKE_APP_ABI=arm64-v8a
set FINE_CMAKE_BUILD_CONFIG=Final
set FINE_CMAKE_BUILD_TARGET=Android
xcopy /s /y %ROOT%\FineObjects\CMakeLists.Minimal.txt %ROOT%\CMakeLists.txt
call %ROOT%\FineObjects\Cmake\build_android.cmd || exit /b !ERRORLEVEL!
if %FINE_CMAKE_BUILD_CONFIG% == Release (
set CMAKE_BUILD_CONFIG=RelWithDebInfo
goto BUILD_CONFIG_OK
) else (
if %FINE_CMAKE_BUILD_CONFIG% == Final (
set CMAKE_BUILD_CONFIG=Release
goto BUILD_CONFIG_OK
) else (
if %FINE_CMAKE_BUILD_CONFIG% == Debug (
set CMAKE_BUILD_CONFIG=Debug
goto BUILD_CONFIG_OK
)
)
)
:BUILD_CONFIG_BAD
echo Bad FINE_CMAKE_BUILD_CONFIG value. Possible values: Final/Release/Debug
exit /b 1
:BUILD_CONFIG_OK
set CMAKE_WORKING_DIR=%ROOT%\_cmake_working_dir\NeoML.Android.%FINE_CMAKE_BUILD_CONFIG%.%FINE_CMAKE_APP_ABI%
if not exist %CMAKE_WORKING_DIR% (
mkdir %CMAKE_WORKING_DIR% || exit /b !ERRORLEVEL!
)
pushd %CMAKE_WORKING_DIR%
echo Building NeoML
echo Building arch: %FINE_CMAKE_APP_ABI%
echo Building configuration: %FINE_CMAKE_BUILD_CONFIG%
cmake -G"Unix Makefiles" ^
-DCMAKE_MAKE_PROGRAM=%FINE_CMAKE_NDK_ROOT%/prebuilt/windows-x86_64/bin/make.exe ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_CONFIG% ^
-DCMAKE_CXX_FLAGS="-w" ^
-DUSE_FINE_OBJECTS=ON ^
-DCMAKE_TOOLCHAIN_FILE=%FINE_CMAKE_NDK_ROOT%/build/cmake/android.toolchain.cmake ^
-DANDROID_ABI=%FINE_CMAKE_APP_ABI% ^
%ROOT%/NeoML/NeoML ^
-DWARNINGS_ARE_ERRORS=ON ^
|| exit /b !ERRORLEVEL!
cmake --build . --target install || exit /b !ERRORLEVEL!
popd