下载tarball
在Chromium官网的Get the Code页面可以找到tarball下载链接
http://chromium-browser-source.commondatastorage.googleapis.com/chromium_tarball.html
解压缩
使用
tar -xzvf chromium.r####.tgz
解压到当前目录
使用git下载depot_tools
git init git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
添加depot_tools到环境变量
修改~/.bashrc
export PATH=$PATH:{your depot_tools location}
配置gclient
在chromium目录下执行
gclient config http://src.chromium.org/svn/trunk/src
runhooks
在chromium目录下执行
#配置ninja export GYP_GENERATORS=ninja gclient runhooks
安装所有依赖的库
sudo ./src/build/install-build-deps.sh
需要安装的库特别多,可能需要比较长的时间。
使用ninja编译
编译需要在src目录下
#Debug版 ninja -C out/Debug chrome #Release版 ninja -C out/Release chrome #编译sandbox ninja -C out/Debug sand_box