最近尝试着在Mac OS X下编译了Chromium,记录如下。
一. 环境配置
1. OS 10.10.4
2. Xcode 6.4,安装Command Line Tools(Xcode menu -> Preferences -> Downloads -> Components -> Command Line Tools)
3. VPN
4. 下载depot_tools。进入准备存放代码的目录
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=$PATH:/path/to/depot_tools
二.下载代码
扫描二维码关注公众号,回复:
4933750 查看本文章
1.获取主干代码
fetch --nohooks chromium
这个过程很慢.
2.切换到稳定版
进入源码目录
git checkout -b chrome_44.0.2403.125_local_branch 44.0.2403.125
3.生成工程文件export GYP_GENERATORS=ninja,xcode-ninja
export GYP_DEFINES=component=shared_library
gclient runhooks
三.编译
1.ninja -C out/Debug chrome
四.调试
- Open the most specific .xcodeproj file that contains the source file in which you want to put a breakpoint.
- Find the file in the file list on the left, apply your desired breakpoints.
- Launch Chromium.
- In Xcode, select Debug > Attach to Process > Chromium.
- Switch to Chromium, do whatever triggers the breakpoint.
- The Xcode debugger will come to the front. Proceed to debug.
参考
1. http://www.chromium.org
2. http://my.oschina.net/ghost045/blog/391787
3. http://blog.csdn.net/echoes19761976/article/details/11847015