文档说明: 只是记录关键点 2023-05-18
因为已经熟练实现 linux 版 chromium,每月自动构建一版。 在此基础上尝试构建 win64 版本
快速构建的办法:
购买抢占式云服务器 ,把配置(比如:32核CPU)买高一点,几个小时据构建完毕了,主要耗时地方是:下载资源
准备工具
| # 用于解压 |
| https://7-zip.org/ |
| |
| # 下载 visualstudio |
| https://visualstudio.microsoft.com/zh-hans/downloads/ |
| |
| # 准备 windows sdk ,下载好并安装 |
| https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ |
| |
| # visualstudio 快速安装 |
| |
| VisualStudioSetup.exe --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended |
| |
| # 准备 depot_tools (用 7-z 解压) |
| https://storage.googleapis.com/chrome-infra/depot_tools.zip |
| |
| depot_tool 加入环境变量 PATH |
| |
| |
配置代理
| # 打开 CMD |
| |
| netsh winhttp set proxy 192.168.3.21:8015 "<local>" |
| set http_proxy=http://192.168.3.21:8015 |
| set https_proxy=http://192.168.3.21:8015 |
| |
| git config --global http.proxy http://192.168.3.21:8015 |
| git config --global https.proxy http://192.168.3.21:8015 |
| |
depot_tools/.cipd_impl.ps1 源文件
| # 给 depot_tools 配置代理 |
| |
| # 使用 Windows PowerShell ISE 文本编辑器 打开 depot_tools/.cipd_impl.ps1 文件 , |
| |
| 找到 110 行左右 ,看到: Invoke-WebRequest -UserAgent $UserAgent -Uri $URL -OutFile $TmpPath |
| |
| |
| 添加代理信息: -Proxy "http://192.168.3.21:8015" ,添加结果如下: |
| |
| Invoke-WebRequest -UserAgent $UserAgent -Uri $URL -OutFile $TmpPath -Proxy "http://192.168.3.21:8015" |
| |
| |
| # 配置代理方法不止这些,详见这里: https://learn.microsoft.com/en-us/powershell/azure/az-powershell-proxy?view=azps-9.7.1&viewFallbackFrom=azps-7.3.2 |
| |
准备下载chromium 源码
| |
| git config --global user.name "jingjingxyk" |
| git config --global user.email "zonghengbaihe521@qq.com" |
| git config --global core.autocrlf false |
| git config --global core.filemode false |
| git config --global branch.autosetuprebase always |
| |
| mkdir chromium && cd chromium |
| fetch --no-history chromium |
| gclient sync |
| |
| 使用 Windows PowerShell ISE 文本编辑器 编辑.gclient 文件,添加 如下配置 |
| |
| "custom_vars": { |
| "checkout_pgo_profiles": True, |
| }, |
| |
| gclient runhooks |
| |
开始构建
| |
| |
| gn gen --args="is_debug=false symbol_level=0 enable_nocompile_tests=false target_cpu=\"x64\" ffmpeg_branding=\"Chrome\" proprietary_codecs=true dcheck_always_on=false is_official_build=true is_component_build=false enable_nacl=false blink_symbol_level=0 v8_symbol_level=0" out/Default |
| |
| ninja -C out/Default chrome |
| |
参考文档
- Get the Code: Checkout, Build, & Run Chromium
- 定制自己的chromium浏览器-linux版
- Microsoft Visual C++ Redistributable latest supported downloads
- 什么是PGO?Profile Guided Optimization是 Microsoft 的 Visual C++ 编译器中提供的优化功能
- gn-build-configuration
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术