-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathv8_compile.bat
More file actions
79 lines (55 loc) · 1.54 KB
/
Copy pathv8_compile.bat
File metadata and controls
79 lines (55 loc) · 1.54 KB
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
@echo off
setlocal
set "dir=%~dp0"
set "v8Dir=%dir%\v8"
if not exist "%v8Dir%" (
echo V8 not found at %v8Dir%
exit /b 1
)
set "depotToolsDir=%dir%\depot_tools"
if not exist "%depotToolsDir%" (
echo Error: depot_tools directory not found at %depotToolsDir%
exit /b 1
)
set "DEPOT_TOOLS_DIR=%depotToolsDir%"
set "DEPOT_TOOLS_WIN_TOOLCHAIN=0"
set "Path=%DEPOT_TOOLS_DIR%;%Path%"
for /F "delims=" %%i in ('call "%dir%\scripts\get_os.bat"') do (
set "os=%%i"
)
for /F "delims=" %%i in ('call "%dir%\scripts\get_arch.bat"') do (
set "targetCpu=%%i"
)
echo Building V8 for %os% %targetCpu%
setlocal EnableDelayedExpansion
set "args="
for /F "usebackq eol=# tokens=*" %%i in ("%dir%\args\%os%.gn") do (
set "args=!args!%%i "
)
endlocal & set "gnArgs=%args%"
set "ccWrapper="
where sccache >nul 2>nul
if not errorlevel 1 (
set "ccWrapper=sccache"
)
set "gnArgs=%gnArgs%cc_wrapper=""%ccWrapper%"""
set "gnArgs=%gnArgs% target_cpu=""%targetCpu%"""
set "gnArgs=%gnArgs% v8_target_cpu=""%targetCpu%"""
pushd "%dir%\v8"
call gn gen ".\out\release" --args="%gnArgs%"
if errorlevel 1 (
echo Failed to generate build files.
exit /b %errorlevel%
)
echo ==================== Build args start ====================
call gn args ".\out\release" --list > "%dir%\gn-args_%os%.txt"
type "%dir%\gn-args_%os%.txt"
echo ==================== Build args end ====================
call ninja -C ".\out\release" -j %NUMBER_OF_PROCESSORS% v8_monolith
if errorlevel 1 (
echo Build failed.
exit /b %errorlevel%
)
dir ".\out\release\obj\v8_*.lib"
popd
endlocal