-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.cmd
74 lines (59 loc) · 1.58 KB
/
build.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set ARG_ERROR=no
for %%a in (%*) do (
set ARG_ERROR=yes
if "%%a"=="x64" (
set BUILD_ARCH=x64
set ARG_ERROR=no
)
if "%%a"=="ia32" (
set BUILD_ARCH=ia32
set ARG_ERROR=no
)
if "%%a"=="release" (
set BUILD_TYPE=release
set ARG_ERROR=no
)
if "%%a"=="debug" (
set BUILD_TYPE=debug
set ARG_ERROR=no
)
if "%%a"=="--use-msvc" (
set BUILD_WITH_MSVC=1
set ARG_ERROR=no
)
if "%%a"=="clean" (
set CLEAN_BUILD=true
set ARG_ERROR=no
)
if "%%a"=="-h" goto usage
if "%%a"=="--help" goto usage
if "!ARG_ERROR!"=="yes" (
echo illegal option "%%a"
goto usage
)
)
cmake -DBUILD_ARCH=%BUILD_ARCH% -DBUILD_TYPE=%BUILD_TYPE% -DBUILD_JOBS=%BUILD_JOBS% -DCLEAN_BUILD=%CLEAN_BUILD% -DBUILD_WITH_MSVC=%BUILD_WITH_MSVC% -P build.cmake
goto finished
:usage
echo.
echo Usage: `basename $0` [options] [-jn] [-v] [-h]
echo Options:
echo release, debug:
echo Specifies the build type.
echo ia32, x64, arm, arm64, mips, mips64, ppc, ppc64:
echo Specifies the architecture for code generation.
echo clean:
echo Clean the build folder.
echo ci:
echo Specifies the environment is CI.
echo -h, --help:
echo Print this message and exit.
echo -j: enable make '-j' option.
echo if 'n' is not given, will set jobs to auto detected core count, otherwise n is used.
echo --use-msvc:
echo force use msvc on Windows, default is clangcl.
echo.
exit /B 1
:finished