forked from JavascriptNet/Javascript.Net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildv8.bat
183 lines (166 loc) · 7.13 KB
/
buildv8.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
:: Build v8 in various modes, using specific versions of Visual Studio.
::
:: This script will trash bits of your environment, particularly your PATH.
@ECHO OFF
SET "usage=usage: %0 ia32/x64 [vs2008/vs2010/vs2012] [toolset] [Debug]"
:: Set directory locations here.
SET python=C:\Python27
SET vs2008=C:\Program Files (x86)\Microsoft Visual Studio 9.0
SET vs2010=C:\Program Files (x86)\Microsoft Visual Studio 10.0
SET vs2012=C:\Program Files (x86)\Microsoft Visual Studio 11.0
SET sdk70=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
SET sdk71=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A
IF EXIST "%sdk71%" (
SET "sdk=%sdk71%"
) ELSE (
SET "sdk=%sdk70%"
)
echo using sdk %sdk%
SET v8=%~dp0%\v8
:: Allow building in just one mode.
IF "%4"=="Debug" (
SET mode=Debug
) ELSE (
IF "%4"=="" (
SET mode=Release
) ELSE (
ECHO %usage%
EXIT /b 1
)
)
:: Parameterise specified architecture.
IF "%1"=="x64" (
SET "x64suffix=\x64"
SET "adm64suffix=\amd64"
SET "target_arch=x64"
SET "profile=%mode%|x64"
) ELSE (
IF "%1"=="ia32" (
SET "x64suffix="
SET "adm64suffix="
SET "target_arch=ia32"
SET "profile=%mode%|Win32"
) ELSE (
ECHO %usage%
EXIT /b 1
)
)
:: Locate build environment.
SET VS=
IF "%2"=="" (
IF EXIST "%vs2012%\VC\bin\cl.exe" (
SET "vs=%vs2012%"
SET "GYP_MSVS_VERSION=2012"
) ELSE (
IF EXIST "%vs2010%\VC\bin\cl.exe" (
SET "vs=%vs2010%"
SET "GYP_MSVS_VERSION=2010"
) ELSE (
IF EXIST "%vs2008%\VC\bin\cl.exe" (
SET "vs=%vs2008%"
SET "GYP_MSVS_VERSION=2008"
) ELSE (
ECHO Cannot find Visual Studio
EXIT /b 1
)
)
)
)
IF "%3" == "" (
SET "msbuild_toolset="
) ELSE (
SET "msbuild_toolset=%3"
)
IF "%vs%"=="" (
IF "%2"=="vs2012" (
SET "vs=%vs2012%"
SET "GYP_MSVS_VERSION=2012"
) ELSE (
IF "%2"=="vs2010" (
SET "vs=%vs2010%"
SET "GYP_MSVS_VERSION=2010"
) ELSE (
IF "%2"=="vs2008" (
SET "vs=%vs2008%"
SET "GYP_MSVS_VERSION=2008"
) ELSE (
ECHO %usage%
EXIT /b 1
)
)
)
)
:: Change to v8 directory.
IF NOT EXIST %v8%\LICENSE.v8 (
ECHO Cannot find v8 checkout at %v8%
EXIT /b 1
)
CD %v8%
:: Have found that sometimes x64 debug builds get stuck on writing to vc100.pdb,
:: so we clean it up. Also VS2008 builds sometimes output gobbledegook.
:: We delete all outputs beforehand to force it to be rebuilt.
RMDIR /S /Q obj >nul 2>&1
RMDIR build\debug /s /q >nul 2>&1
RMDIR build\release /s /q >nul 2>&1
DEL *.idb >nul 2>&1
DEL *.pdb >nul 2>&1
DEL *.lib >nul 2>&1
DEL /S *.sln >nul 2>&1
DEL /S *.vcproj >nul 2>&1
DEL /S *.vcxproj >nul 2>&1
DEL /S *.vcxproj.user >nul 2>&1
:: Run gyp to update the Visual Studio project files to contain links
:: to the latest v8 source files.
echo third_party\python_26\python.exe build\gyp_v8 -D"target_arch=%target_arch%" -D"component=shared_library" -Dv8_enable_i18n_support=0
third_party\python_26\python.exe build\gyp_v8 -D"target_arch=%target_arch%" -D"component=shared_library" -Dv8_enable_i18n_support=0
IF "%vs%"=="%vs2012%" (
IF "%msbuild_toolset%"=="v100" (
IF "%sdk%"=="%sdk71%" (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
) ELSE (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>v100</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>v100</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
)
) ELSE (
IF "%msbuild_toolset%"=="v90" (
IF "%sdk%"=="%sdk71%" (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
) ELSE (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v110</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
)
)
)
) ELSE (
IF "%vs%"=="%vs2010%" (
IF "%msbuild_toolset%"=="v90" (
IF "%sdk%"=="%sdk71%" (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
) ELSE (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
)
) ELSE (
IF "%sdk%"=="%sdk71%" (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
) ELSE (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>v100</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v100</PlatformToolset>" "<PlatformToolset>v100</PlatformToolset><TargetFrameworkVersion>v4.0</TargetFrameworkVersion>"
)
)
) ELSE (
IF "%sdk%"=="%sdk71%" (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v90</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v90</PlatformToolset>" "<PlatformToolset>Windows7.1SDK</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
) ELSE (
echo ..\fart -r -i "*.vcxproj" "<PlatformToolset>v90</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
..\fart -r -i "*.vcxproj" "<PlatformToolset>v90</PlatformToolset>" "<PlatformToolset>v90</PlatformToolset><TargetFrameworkVersion>v3.5</TargetFrameworkVersion>"
)
)
)
echo "%vs%\Common7\IDE\devenv.com" /build "%profile%" build\All.sln
"%vs%\Common7\IDE\devenv.com" /build "%profile%" build\All.sln