Windows下编译Chromium

一、系统要求
1、Windows 7或更新的64位系统,至少有8GB内存,强烈推荐超过16GB;
2、源码必须存放在NTFS格式的驱动器上,至少有100GB的空闲磁盘空间;
3、安装合适版本的Visual Studio

二、配置Visual Studio
。截止到2017年9月(R503915),Chromium需要Visual Studio 2017 (15.7.2)编译。必须安装“桌面开发用C++”组件和“MFC和ATL支持”的子组件。

三、代理设置(如有需要)
1、Git代理设置;
git config --global https.proxy socks5://localhost:1080
git config --global core.proxy socks5://localhost:1080
git config --global http.proxy socks5://localhost:1080
git config --global http.sslVerify false
Git取消代理;
git config --global --unset http.proxy
git config --global --unset httpx.proxy
git config --global --unset core.proxy
2、Python代理设置;
set http_proxy=http://localhost:1080
set https_proxy=https://localhost:1080
四、安装配置depot_tools

下载depot_tools压缩包https://src.chromium.org/svn/trunk/tools/depot_tools.zip解压, 把depot_tools设置为环境变量, 并且设置环境变量DEPOT_TOOLS_WIN_TOOLCHAIN的值为0;

五、源码下载

1、创建一个chromium目录存放源码(可以在任何地方,只要路径是英文且没空格就行);

mkdir chromium && cd chromium
2、运行depot_tools检查依赖项与检出源码;
fetch chromium
如果不需要历史记录可以添加参数--no-history
fetch chromium --no-history

当fetch完成,会在工作目录创建src目录与一个隐藏的文件.gclient。

gclient runhooks下载gs://xxx出错,设置 .boto内容
[Boto]
proxy = 127.0.0.1
proxy_port = 1080
执行命令
set NO_AUTH_BOTO_CONFIG=E:\Working\ChromiumSrc\.boto
六、编译
cd src
gn gen --ide=vs out\Default
devenv out\Default\all.sln

猜你喜欢

转载自blog.csdn.net/sanve/article/details/80882562