-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathbuild.bat
96 lines (83 loc) · 1.96 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@echo off
setlocal
if "%TD_CONFIG%"=="" set "TD_CONFIG=Debug"
for /F "tokens=1,* delims= " %%A in ("%*") do (
if "%%A" EQU "gen" (
call :do_gen %%B
exit /B
)
if "%%A" EQU "bld" (
call :do_bld %%B
exit /B
)
if "%%A" EQU "install" (
call :do_stop
call :do_install %%B
exit /B
)
if "%%A" EQU "test" (
call :do_test %%B
exit /B
)
if "%%A" EQU "start" (
call :do_start
exit /B
)
if "%%A" EQU "stop" (
call :do_stop
exit /B
)
if "%%A" EQU "purge" (
call :do_stop
call :do_purge
exit /B
)
)
echo "env TD_CONFIG denotes which to build for: <Debug/Release>, Debug by default"
echo "to generate make files: .\build.bat gen [cmake options]"
echo "to build: .\build.bat bld [cmake options for --build]"
echo "to install: .\build.bat install [cmake options for --install]"
echo "to run test: .\build.bat test [ctest options]"
echo "to start: .\build.bat start"
echo "to stop: .\build.bat stop"
echo "to purge: .\build.bat purge"
exit /B
:do_gen
cmake -B debug -G "NMake Makefiles" ^
-DLOCAL_REPO:STRING=%LOCAL_REPO% ^
-DLOCAL_URL:STRING=%LOCAL_URL% ^
-DBUILD_TOOLS=true ^
-DBUILD_KEEPER=true ^
-DBUILD_HTTP=false ^
-DBUILD_TEST=true ^
-DWEBSOCKET=true ^
-DBUILD_DEPENDENCY_TESTS=false ^
%*
exit /B
:do_bld
cmake --build debug --config %TD_CONFIG% -j4 %*
exit /B
:do_install
cmake --install debug --config %TD_CONFIG% %*
exit /B
:do_start
sc start taosd
sc start taosadapter
sc start taoskeeper
exit /B
:do_stop
sc stop taoskeeper
sc stop taosadapter
sc stop taosd
exit /B
:do_purge
sc delete taoskeeper
sc delete taosadapter
sc delete taosd
rmdir /s /q C:\TDengine
exit /B
:do_test
ctest --test-dir debug -C %TD_CONFIG% --output-on-failure %*
exit /B
endlocal
exit /B