forked from pit-ray/win-vind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
103 lines (89 loc) · 2.95 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
97
98
99
100
101
102
103
@chcp 65001
@echo Usage: build.bat [-debug/-release] [-msvc/-mingw] [32/64]
@if "%1" == "" (
@set build_type=-debug
) else if "%1" == "-help" (
@ exit
) else (
@set build_type=%1
)
@if "%2" == "" (
@set compiler=-mingw
) else (
@set compiler=%2
)
@if %build_type% == -release (
@goto release
) else if %build_type% == -coverity (
@goto coverity
) else if %build_type% == -test (
@goto test
) else if %build_type% == -coveralls (
@goto coveralls
) else (
@goto debug
)
:release
@if %3 neq 64 (
@if %3 neq 32 (
@echo Error: Please pass bit type 32 or 64 as the third argument.
exit
)
)
@if %compiler% == -msvc (
if %3 == 32 (
cmake -B release_32 -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A win32 -DBIT_TYPE=32 .
cmake --build release_32 --config Release
xcopy /e /Y ".\\release_32\\coregui\\Release\\*.exe" "release_32"
) else (
cmake -B release_64 -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64 -DBIT_TYPE=64 .
cmake --build release_64 --config Release
xcopy /e /Y ".\\release_64\\coregui\\Release\\*.exe" "release_64"
)
) else (
if %3 == 32 (
@echo Error: Building 32bit win-vind using MinGW is not supported.
@goto exit
)
cmake -B release -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" -DBIT_TYPE=%3 .
cmake --build release --config Release
xcopy /e /Y ".\\release\\coregui\\*.exe" "release"
)
@goto exit
:debug
@if %compiler% == -msvc (
Del /q "debug/Debug"
if "%3" == "32" (
cmake -B debug -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" -A win32 -DBIT_TYPE=32 .
cmake --build debug --config Debug
) else (
cmake -B debug -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" -A x64 -DBIT_TYPE=64 .
cmake --build debug --config Debug
)
xcopy /e /Y ".\\debug\\coregui\\Debug\\*.exe" "debug"
) else (
cmake -B debug -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" -DBIT_TYPE=64 -DCCACHE_ENABLE=OFF .
cmake --build debug --config Debug
xcopy /e /Y ".\\debug\\coregui\\*.exe" "debug"
)
@goto exit
:coverity
cov-configure --config debug/covtest/cov.xml --comptype g++ --compiler g++ --template --xml-option=skip_file:".*/libs.*" --xml-option=skip_file:".*/mingw64.*"
cmake -B debug -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" -DBIT_TYPE=64 -DCCACHE_ENABLE=OFF .
cd debug
cov-build --config ./covtest/cov.xml --dir cov-int cmake --build .
tar -czvf cov-int.tgz cov-int
cd ..
@goto exit
:test
cmake -B test/build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" test
cmake --build test/build
cd test/build
ctest -C Debug
cd ../..
@goto exit
:coveralls
coveralls --include core --repo_token "%2"
@goto exit
:exit
@echo done.