配置
命令行翻墙设置
Windows 命令行设置
1 | set http_proxy=127.0.0.1:1080 |
Git 设置
1 | git config --global http.proxy 127.0.0.1:1080 |
获取代码
gclient sync 参数
–nohooks
–no-history
–with_branch_heads
–with_tags
–output-json
编译
DEPOT_TOOLS_WIN_TOOLCHAIN
GYP_GENERATORS=msvs-ninja,ninja
GYP_DEFINES
buildtype=Official
如果不添加 buildtype=Official
可能会遇到下面问题:
- XP 系统不能正常运行
在添加了该编译参数情况下,也会遇到某些奇怪问题:
- 在某些机器上,当打开某些页面,比如新浪视频,退出浏览器后,会收到网络层不能析构的 bug
gclient runhooks
gclient runhooks 会做二件事:一是检查编译环境,二是生成编译脚本。我们也可以跳过检查编译环境,直接生成编译脚本:
生成全部脚本
1 | python src\build\gyp_chromium |
生成某个工程
1 | chrome 工程 |
Goutput_dir
错误
查找错误
1 | ninja -C src/out/Debug chrome | findstr error |
VS 忽略错误
VS2015 编译时会遇到一些错误,通过以下设置解决
1 | 4334, # |
gclient sync 错误 1
1 |
|
解决办法:
1 | gclient sync --with_branch_heads |
gclient sync 错误 2
1 | Cannot rebase:You have unstaged changes. |
解决办法:
忽略行结尾的不一致:
1 | git config --global core.autocrlf true |
Windows 系统语言错误
1 | The file contains a character that cannot berepresented in the current code page. |
解决办法:
依次打开:Region and Language > Administrative > Langeuage for non-Unicode programs
点击 Change system locale…,切换为 English (United State)