chrome源代码下载
1、请确保可以翻墙,建议使用稳定一点的VPN。
2、安装vs2013和windows 8.1 sdk。
3、下载depot,解压并将解压路径设置为PATH环境变量:
http://src.chromium.org/svn/trunk/tools/depot_tools.zip
4、进入本地下载目录(随便指定,例如d:chrome),下载源码:
下载主干代码
fetch --nohooks --no-history chromium --nosvn=true
或下载某个版本(未测试),如44.0.2403.155
cd src
git fetch --tags >>tags.txt 2>&1 //标签号44.0.2403.155会保存在tags.txt文件中
git checkout -b chrome_44.0.2403.155_local_branch 44.0.2403.155
gclient sync --with_branch_heads --jobs 16
ps:这个过程会持续很长时间,而且网络不能中断,一旦中断,必须重新下载,因为git不支持断点续传。
5、如何解决编译过程中unicode的编码的warning问题:
在srcuildcommon.gypi文件中查找到字符串"4611",回车增加字符串"4819,4067,"
用记事本打开srccomponentsautofillcorerowserautofill_regex_constants.cc并另存为ANSI编码
6、设置编译环境配置:
set GYP_GENERATORS=msvs-ninja,ninja
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2013
set GYP_DEFINES=component=shared_library
7、在"src"源码目录(例如d:chromesrc)生成配置文件,如工程文件等:
gclient runhooks
ps:这个过程也很长
这个命令会下载一些必须的工具,命令行后结果:
D:chrome2015>gclient runhooks
Installing python 2.7.6...
Fetching from https://src.chromium.org/svn/trunk/tools/third_party/python276_bin
.zip
Installing git 1.9.5.chromium.6 (avg 1-2 min download) ...
Fetching from https://commondatastorage.googleapis.com/chrome-infra/git-1.9.5.ch
romium.6_bin.zip
Installing subversion ...
Fetching from https://src.chromium.org/svn/trunk/tools/third_party/svn_bin.zip
8、编译:
cd src
ninja -C outDebug chrome
或
vs2013打开srcchromechrome.sln进行编译(此方法非常慢,建议vs2013只用于调试代码)
9、更新(未测试):
git rebase-update
gclient sync --force –nohooks
10、参考链接:
https://www.chromium.org/developers/how-tos/get-the-code
http://blog.gclxry.com/?p=364
http://www.suninf.net/2015/08/chromium-44-build-and-debug.html
http://my.oschina.net/ghost045/blog/395973
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: Google Chrome 源码下载
- 下一篇: chrome源码分析1:content模型