forked from fibjs/fibjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
103 lines (82 loc) · 2.13 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
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
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
if defined ProgramFiles(x86) (set HOST_ARCH=amd64) else (set HOST_ARCH=i386)
set TARGET_ARCH=!HOST_ARCH!
set BUILD_TYPE=release
set XP=_xp
set MT=/m
set ARG_ERROR=no
for %%a in (%*) do (
set ARG_ERROR=yes
if "%%a"=="amd64" (
set TARGET_ARCH=amd64
set ARG_ERROR=no
)
if "%%a"=="i386" (
set TARGET_ARCH=i386
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
set MT=
)
if "%%a"=="noxp" (
set XP=""
set ARG_ERROR=no
)
if "%%a"=="clean" (
set BUILD_TYPE=clean
set ARG_ERROR=no
)
if "%%a"=="-h" goto usage
if "%%a"=="--help" goto usage
if "!ARG_ERROR!"=="yes" (
echo illegal option "%%a"
goto usage
)
)
if "!BUILD_TYPE!"=="clean" (
if "!TARGET_ARCH!"=="amd64" (
rmdir /S/Q out\Windows_amd64_Debug
rmdir /S/Q out\Windows_amd64_Release
)
if "!TARGET_ARCH!"=="i386" (
rmdir /S/Q out\Windows_i386_Debug
rmdir /S/Q out\Windows_i386_Release
)
goto out
)
if "!TARGET_ARCH!"=="amd64" (set Platform=x64) else (set Platform=Win32)
set vs_ver=%VisualStudioVersion:.=%
if "!vs_ver!"=="150" (set vs_ver=141)
msbuild fibjs.sln /t:Build /p:Configuration=!BUILD_TYPE!;Platform=!Platform!;PlatformToolset=v!vs_ver!!XP! !MT!
if "!BUILD_TYPE!"=="release" (
cd bin\Windows_!TARGET_ARCH!_!BUILD_TYPE!
fibjs ../../fibjs/gen_install.js
cd ..\..
cd installer
msbuild installer.sln /t:Build /p:Configuration=Release;Platform=!Platform!;PlatformToolset=v!vs_ver!!XP! !MT!
cd ..
)
goto out
:usage
echo.
echo Usage: build [release ^| debug ^| i386 ^| amd64 ^| noxp ^| clean] [-h]
echo Options:
echo release, debug:
echo Specifies the build type.
echo i386, amd64:
echo Specifies the architecture for code generation.
echo noxp:
echo Remove xp support build.Default supported.
echo clean:
echo Clean the build folder.
echo -h, --help:
echo Print this message and exit.
echo.
:out