OLD | NEW |
1 # Mac Build Instructions | 1 # Mac Build Instructions |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 ## Prerequisites | 5 ## Prerequisites |
6 | 6 |
7 * A Mac running 10.9+. | 7 * A Mac running 10.9+. |
8 * [Xcode](https://developer.apple.com/xcode), 5+. | 8 * [Xcode](https://developer.apple.com/xcode), 5+. |
9 * Install | 9 * Install |
10 [gclient](http://dev.chromium.org/developers/how-tos/install-depot-tools), | 10 [gclient](http://dev.chromium.org/developers/how-tos/install-depot-tools), |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ## Using Xcode-Ninja Hybrid | 136 ## Using Xcode-Ninja Hybrid |
137 | 137 |
138 While using Xcode is unsupported, GYP supports a hybrid approach of using ninja | 138 While using Xcode is unsupported, GYP supports a hybrid approach of using ninja |
139 for building, but Xcode for editing and driving compilation. Xcode can still be | 139 for building, but Xcode for editing and driving compilation. Xcode can still be |
140 slow, but it runs fairly well even **with indexing enabled**. | 140 slow, but it runs fairly well even **with indexing enabled**. |
141 | 141 |
142 With hybrid builds, compilation is still handled by ninja, and can be run by the | 142 With hybrid builds, compilation is still handled by ninja, and can be run by the |
143 command line (e.g. ninja -C out/Debug chrome) or by choosing the chrome target | 143 command line (e.g. ninja -C out/Debug chrome) or by choosing the chrome target |
144 in the hybrid workspace and choosing build. | 144 in the hybrid workspace and choosing build. |
145 | 145 |
146 To use Xcode-Ninja Hybrid, set `GYP_GENERATORS=ninja,xcode-ninja`. | 146 To use Xcode-Ninja Hybrid, set GYP\_GENERATORS like the following: |
| 147 |
| 148 ```shell |
| 149 export GYP_GENERATORS="ninja,xcode-ninja" |
| 150 ``` |
147 | 151 |
148 Due to the way Xcode parses ninja output paths, it's also necessary to change | 152 Due to the way Xcode parses ninja output paths, it's also necessary to change |
149 the main gyp location to anything two directories deep. Otherwise Xcode build | 153 the main gyp location to anything two directories deep. Otherwise Xcode build |
150 output will not be clickable. Adding | 154 output will not be clickable. |
151 `xcode_ninja_main_gyp=src/build/ninja/all.ninja.gyp` to your | 155 To make this change permanent, you can edit `chromium.gyp_env` (or create it if |
152 `GYP_GENERATOR_FLAGS` will fix this. | 156 it does not exists) and define GYP\_GENERATOR\_FLAGS. In general, to use hybrid |
| 157 mode, your `chromium.gyp_env` could contain the following: |
153 | 158 |
154 After generating the project files with gclient runhooks, open | 159 ```json |
155 `src/build/ninja/all.ninja.xcworkspace`. | 160 { |
| 161 "GYP_GENERATORS" : "ninja,xcode-ninja", |
| 162 "GYP_GENERATOR_FLAGS": |
| 163 "xcode_project_version=3.2 " + |
| 164 "xcode_ninja_main_gyp=src/build/ninja/all.ninja.gyp", |
| 165 } |
| 166 ``` |
| 167 |
| 168 After, generate the project files with: |
| 169 |
| 170 ```shell |
| 171 gclient runhooks |
| 172 ``` |
| 173 |
| 174 And finally, open it: |
| 175 |
| 176 ```shell |
| 177 open build/ninja/all.ninja.xcworkspace |
| 178 ``` |
156 | 179 |
157 You may run into a problem where http://YES is opened as a new tab every time | 180 You may run into a problem where http://YES is opened as a new tab every time |
158 you launch Chrome. To fix this, open the scheme editor for the Run scheme, | 181 you launch Chrome. To fix this, open the scheme editor for the Run scheme, |
159 choose the Options tab, and uncheck "Allow debugging when using document | 182 choose the Options tab, and uncheck "Allow debugging when using document |
160 Versions Browser". When this option is checked, Xcode adds | 183 Versions Browser". When this option is checked, Xcode adds |
161 `--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` gets | 184 `--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` gets |
162 interpreted as a URL to open. | 185 interpreted as a URL to open. |
163 | 186 |
164 If you want to limit the number of targets visible, which is known to improve | 187 If you want to limit the number of targets visible, which is known to improve |
165 Xcode performance, add `xcode_ninja_executable_target_pattern=%target%` where | 188 Xcode performance, add `xcode_ninja_executable_target_pattern=%target%` where |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 be set in `/etc/sysctl.conf`: | 249 be set in `/etc/sysctl.conf`: |
227 | 250 |
228 echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf | 251 echo kern.maxvnodes=$((512*1024)) | sudo tee -a /etc/sysctl.conf |
229 | 252 |
230 Or edit the file directly. | 253 Or edit the file directly. |
231 | 254 |
232 If your `git --version` reports 2.6 or higher, the following may also improve | 255 If your `git --version` reports 2.6 or higher, the following may also improve |
233 performance of `git status`: | 256 performance of `git status`: |
234 | 257 |
235 git update-index --untracked-cache | 258 git update-index --untracked-cache |
OLD | NEW |