Win10 编译 chromium 58

来源:互联网 发布:小米4c后盖淘宝 编辑:程序博客网 时间:2024/05/21 08:50


尝试编译Stable-chromium-58.0.3029.81

链接: https://pan.baidu.com/s/1c16vZ0W 密码: 55f1


一、系统要求
A、64位的Intel 架构电脑,至少8G RAM,推荐16GB。
B、至少100GB磁盘空间,NTFS格式。由于部分字节包超过4G,不能使用FAT32格式 。
C、Visual Studio 2015 Update 3(其它版本不支持)。
D、Windows 7 或 更新。

二、Visual Studio
  自2016年12月8日开始 ,Chromium要求使用Visual Studio 2015 以及  Windows SDK 14393来编译。
1、安装Visual Studio 2015 Update 3或最新版本,安装时自定义择择如下选项:
A、Visual C++,同时选择三项子项。
B、通用Windows应用工发工具:Tools (1.4.1) and Windows 10 SDK (10.0.14393)。

    必须安装Windows 10 SDK (10.0.14393),否则你将非常讨厌诸如“未定义(undefined)或重复定义(redefined)的宏“编译错误。安装Windows SDK 10,同时选择调试工具,以获得windbg。
2、若无C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe
   则需要安装Debuggers And Tools for windows10。
   见X64 Debuggers And Tools-x64_en-us.msi。

三、安装depot_tools
A、解压depot_tools-2017-1-ALL.rar到c:\ depot_tools
B、添加系统变量
在PATH路径中增加:c:\ depot_tools
该路径放置在PATH变量最前面,或至少应该在其他可能含有Python或GIT拷贝的路径的前面。
C、DEPOT_TOOLS_WIN_TOOLCHAIN
新增一个系统变量,名为“DEPOT_TOOLS_WIN_TOOLCHAIN“,值为”0“。该变量的作用是告诉depot_tools使用本地安装的Visual Studio版本(depot_tools默认是使用google内部版本)。

四、解压
Stable-chromium-58.0.3029.81.tar.xz至D:\chromium58。

五、支持文件
将develop-for-Stable-chromium-58.0.3029.81.rar解压。

拷到D:\chromium58 覆盖相应的文件。

注:如果是英文系统,请删除文件夹“cc“和”components“。(更改文本编码,以解决中文系统编译时识别编码报错的问题)。

六、在cmd中运行(源码目录下):
gn gen out\Default --args="enable_nacl=false"
在out\Default中会拷贝并生成一系列需要的文件。
注:Default也可以用其他名字。

七、修改编译选项
注:英文操作系统不需要该操作。
使用search and replace工具,选择搜索子目录:

查找D:\chromium58\out\Default目录中全部文件,将’ /WX ’替换成’ ’ 。

八、设置syzygy
由于google使用syzygy对exe进行优化,修改如下:
1、解压\Source\Chromium\syzygy_bin.zip到:D:\syzygy_bin
2、修改D:\chromiumsrc\build\win\reorder-imports.py,如下:

swap_exe = 'D:\\syzygy_bin\\swapimport.exe'

九、编译
在cmd中运行(源码目录下):
ninja -C out\Default chrome
27193步,需要等待几个小时。

















2 0
原创粉丝点击