-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.bat
56 lines (40 loc) · 1.17 KB
/
build.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
49
50
51
52
53
54
55
56
@echo OFF
setlocal
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: check needed tool set ok
where /q cmake
if ERRORLEVEL 1 (
echo command cmake does not find.
echo make sure cmake is installed and placed in path.
exit /B
)
where /q cl
if ERRORLEVEL 1 (
echo command msvc cl does not find.
echo make sure msvc cl is installed and placed in path.
exit /B
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal enabledelayedexpansion
:: trace build time
set build_start_time=%time%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo generate cmake files
:: select msvc for cmake
set CC=cl
set CXX=cl
set ld=link
set build_dir=tmp\build_win
if not exist %build_dir% mkdir %build_dir%
pushd %build_dir% 1> nul
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../..
popd 1> nul
echo ninja build
pushd %build_dir% 1> nul
ninja
popd 1> nul
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:END
set build_end_time=%time%
echo use time %build_start_time% -- %build_end_time%
endlocal