mac os X 下编译 chromium

本文转自http://blog.csdn.net/echoes19761976/article/details/11847015

1. prerequisites

  (1)  我的 OS 版本 10.8。

(2)下载xcode4.x,我用的是4.6,讲Xcode.app拖进Application。

         安装完Xcode后,在Xcode中安装Command Line Tools”, 执行 Xcode menu -> Preferences -> Downloads -> Components -> Command Line Tools -> Install

(3)下载chromium源码,

           由于gclient sync比较慢,所以就没更新代码,直接下载tar包,解压,解压后代码存放位置:~/chromium/ 。

           在~/chromium/src/下执行gclient runhooks --force。


2. start compile

(1)编译之前,首先配置一下chrome工程的属性,在Finder中双击 ~/chromium/src/chrome/chrome.xcodeproj,之后在Xcode中执行以下操作

a. Xcode → Preferences → General → Turn off Live Issues (for In Editors and In Issue Navigator)

b. Set Xcode → Preferences → Locations → Advanced -> Legacy // 这一步比较重要,会指定编译输出目录。

c. 在命令行执行 defaults write com.apple.dt.XCode IDEIndexDisable 1

d. Xcode → Product → Edit Scheme → Run -> Arguments -> + -> 输入命令行参数:(e.g. --user-data-dir=/profile_dir) -> + -> --single-process


(2)开始编译

在Xcode UI中编译比较慢(主要是链接步骤比较慢),最快的是在ninja中编译,可是我想用Xcode的调试界面,所以就用xcodebuild(Xcode的命令行工具)。

cd ~/chromium/src/chrome/

执行:  xcodebuild -project chrome.xcodeproj -configuration Debug -target chrome

假如想全部编译(其中包含很多单元测试的代码)就执行:

xcodebuild -project chrome.xcodeproj -configuration Debug -target all


3. debug

打开~/chromium/src/chrome/chrome.xcodeproj,点击run,ok,可以开始设置断点调试了。



猜你喜欢

转载自blog.csdn.net/SouthRR/article/details/45972509