Intro: Setup of V8 & Chrome
V8 Build
linux
Pre Work
Install Git
1
apt-get install git
Install depot_tools
1
2git clone https://chromium.googlesource.com/chromium/tools/depot_tools
export PATH=~/depot_tools:"$PATH"
Key Step
BUILD.sh
1
2
3
4
5
6gclient
mkdir v8
cd v8
fetch v8
tools/dev/v8gen.py x64.debug
ninja -C out.gn/x64.debug此时编译的是最新版本的v8,若想切换分支,执行:
1
2
3
4
5
6
7git reset --hard +hash
tools/dev/v8gen.py x64.debug
ninja -C out.gn/x64.debug
OR
./build/install-build-deps.sh
./tools/dev/gm.py x64.release
Windows
Prework
- Visual Studio 2017
- 设置 git cookie
- Windows SDK
Key STAP
- 打开适用于 VS 2017 的 X64 本机工具命令提示框
- 再次确认上一步已完成,注意不是cmd窗口
1
2
3
4
5
6
7
8
9
10git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
SET depot_tools 环境变量,将其放在存有python.exe的环境变量前或者直接置顶
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2017
mkdir v8 && cd v8
fetch v8
cd v8
gn gen --ide=vs out.gn\x64_solution
python tools\dev\v8gen.py x64.release
ninja -C out.gn\x64.release
Chrome Build
Windows
Pre Work
Install Git
1
apt-get install git
Install depot_tools
1
2git clone https://chromium.googlesource.com/chromium/tools/depot_tools
export PATH=~/depot_tools:"$PATH"
Key Step
- BUILD.sh
1
2
3
4
5
6
7
8
9
10set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2017
gclient
mkdir chromium && cd chromium
fetch chromium
git checkout -b <local-branch-name> tags/<tag name>
gclient sync
cd src
gn gen --ide=vs out/Default
ninja -C out/Default chrome
Preparing Turbolizer
1 | cd tools/turbolizer |