V8 & Chrome Setup

V8 & Chrome Setup

Intro: Setup of V8 & Chrome

V8 Build

linux

Pre Work

  • Install Git

    1
    apt-get install git
  • Install depot_tools

    1
    2
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools
    export PATH=~/depot_tools:"$PATH"

Key Step

  • BUILD.sh

    1
    2
    3
    4
    5
    6
    gclient
    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
    7
    git 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

Key STAP

  • 打开适用于 VS 2017 的 X64 本机工具命令提示框
  • 再次确认上一步已完成,注意不是cmd窗口
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    git 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
    2
    git 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
    10
    set 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
2
3
4
cd tools/turbolizer
npm i
npm run-script build
python -m SimpleHTTPServer

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×