Chromium Code Reviews| 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 * [depot\_tools](http://dev.chromium.org/developers/how-tos/depottools). | 9 * [depot\_tools](http://dev.chromium.org/developers/how-tos/depottools). |
| 10 * Xcode Command Line Tools. Run | 10 * Xcode Command Line Tools. Run |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 | 65 |
| 66 But normally this shouldn't be necessary if you're building on 10.7 or higher. | 66 But normally this shouldn't be necessary if you're building on 10.7 or higher. |
| 67 If you see this, check if some rogue program spawned hundreds of processes and | 67 If you see this, check if some rogue program spawned hundreds of processes and |
| 68 kill them first. | 68 kill them first. |
| 69 | 69 |
| 70 ## Faster builds | 70 ## Faster builds |
| 71 | 71 |
| 72 Full rebuilds are about the same speed in Debug and Release, but linking is a | 72 Full rebuilds are about the same speed in Debug and Release, but linking is a |
| 73 lot faster in Release builds. | 73 lot faster in Release builds. |
| 74 | 74 |
| 75 Run | 75 Add |
| 76 | 76 |
| 77 GYP_DEFINES=fastbuild=1 build/gyp_chromium | 77 symbol_level=1 |
| 78 | 78 |
| 79 to disable debug symbols altogether, this makes both full rebuilds and linking | 79 to your [GN](../tools/gn/docs/quick_start.md) config to disable debug symbols |
| 80 faster (at the cost of not getting symbolized backtraces in gdb). | 80 altogether. This makes both full rebuilds and linking faster (at the cost of |
| 81 not getting symbolized backtraces in gdb). | |
| 81 | 82 |
| 82 You might also want to [install ccache](ccache_mac.md) to speed up the build. | 83 You might also want to [install ccache](ccache_mac.md) to speed up the build. |
| 83 | 84 |
| 84 ## Running | 85 ## Running |
| 85 | 86 |
| 86 All build output is located in the `out` directory (in the example above, | 87 All build output is located in the `out` directory (in the example above, |
| 87 `~/chromium/src/out`). You can find the applications at | 88 `~/chromium/src/out`). You can find the applications at |
| 88 `{Debug|Release}/ContentShell.app` and `{Debug|Release}/Chromium.app`, depending | 89 `{Debug|Release}/ContentShell.app` and `{Debug|Release}/Chromium.app`, depending |
| 89 on the selected configuration. | 90 on the selected configuration. |
| 90 | 91 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 command line, that is possible without building in Xcode. See | 125 command line, that is possible without building in Xcode. See |
| 125 [Debugging in Xcode](http://www.chromium.org/developers/debugging-on-os-x/buildi ng-with-ninja-debugging-with-xcode) | 126 [Debugging in Xcode](http://www.chromium.org/developers/debugging-on-os-x/buildi ng-with-ninja-debugging-with-xcode) |
| 126 for information on how. | 127 for information on how. |
| 127 | 128 |
| 128 ## Contributing | 129 ## Contributing |
| 129 | 130 |
| 130 Once you’re comfortable with building Chromium, check out | 131 Once you’re comfortable with building Chromium, check out |
| 131 [Contributing Code](http://dev.chromium.org/developers/contributing-code) for | 132 [Contributing Code](http://dev.chromium.org/developers/contributing-code) for |
| 132 information about writing code for Chromium and contributing it. | 133 information about writing code for Chromium and contributing it. |
| 133 | 134 |
| 134 ## Using Xcode-Ninja Hybrid | 135 ## Using Xcode |
| 135 | 136 |
| 136 While using Xcode is unsupported, GYP supports a hybrid approach of using ninja | 137 Use the `--ide="xcode"` when running `gn gen` to generate the workspace, then |
| 137 for building, but Xcode for editing and driving compilation. Xcode can still be | 138 open it: |
| 138 slow, but it runs fairly well even **with indexing enabled**. | |
| 139 | |
| 140 With hybrid builds, compilation is still handled by ninja, and can be run by the | |
| 141 command line (e.g. ninja -C out/Debug chrome) or by choosing the chrome target | |
| 142 in the hybrid workspace and choosing build. | |
| 143 | |
| 144 To use Xcode-Ninja Hybrid, set GYP\_GENERATORS like the following: | |
| 145 | |
| 146 ```shell | |
| 147 export GYP_GENERATORS="ninja,xcode-ninja" | |
| 148 ``` | |
| 149 | |
| 150 Due to the way Xcode parses ninja output paths, it's also necessary to change | |
| 151 the main gyp location to anything two directories deep. Otherwise Xcode build | |
| 152 output will not be clickable. | |
| 153 To make this change permanent, you can edit `chromium.gyp_env` (or create it if | |
| 154 it does not exists) and define GYP\_GENERATOR\_FLAGS. In general, to use hybrid | |
| 155 mode, your `chromium.gyp_env` could contain the following: | |
| 156 | |
| 157 ```json | |
| 158 { | |
| 159 "GYP_GENERATORS" : "ninja,xcode-ninja", | |
| 160 "GYP_GENERATOR_FLAGS": | |
| 161 "xcode_project_version=3.2 " + | |
| 162 "xcode_ninja_main_gyp=src/build/ninja/all.ninja.gyp", | |
| 163 } | |
| 164 ``` | |
| 165 | |
| 166 After, generate the project files with: | |
| 167 | |
| 168 ```shell | |
| 169 gclient runhooks | |
| 170 ``` | |
| 171 | |
| 172 And finally, open it: | |
| 173 | 139 |
| 174 ```shell | 140 ```shell |
| 175 open build/ninja/all.ninja.xcworkspace | 141 open build/ninja/all.ninja.xcworkspace |
| 176 ``` | 142 ``` |
| 177 | 143 |
| 178 You may run into a problem where http://YES is opened as a new tab every time | 144 You may run into a problem where http://YES is opened as a new tab every time |
| 179 you launch Chrome. To fix this, open the scheme editor for the Run scheme, | 145 you launch Chrome. To fix this, open the scheme editor for the Run scheme, |
| 180 choose the Options tab, and uncheck "Allow debugging when using document | 146 choose the Options tab, and uncheck "Allow debugging when using document |
| 181 Versions Browser". When this option is checked, Xcode adds | 147 Versions Browser". When this option is checked, Xcode adds |
| 182 `--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` gets | 148 `--NSDocumentRevisionsDebugMode YES` to the launch arguments, and the `YES` gets |
| 183 interpreted as a URL to open. | 149 interpreted as a URL to open. |
| 184 | 150 |
| 185 If you want to limit the number of targets visible, which is known to improve | |
| 186 Xcode performance, add `xcode_ninja_executable_target_pattern=%target%` where | |
|
vabr (Chromium)
2016/08/09 13:13:40
I suppose that this might still be needed, but not
| |
| 187 `%target%` is a regular expression matching executable targets you'd like to | |
| 188 include. | |
| 189 | |
| 190 To include non-executable targets, use `xcode_ninja_target_pattern=All_iOS`. | |
|
vabr (Chromium)
2016/08/09 13:13:40
Ditto.
| |
| 191 | |
| 192 If you have problems building, join us in `#chromium` on `irc.freenode.net` and | 151 If you have problems building, join us in `#chromium` on `irc.freenode.net` and |
| 193 ask there. As mentioned above, be sure that the | 152 ask there. As mentioned above, be sure that the |
| 194 [waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the tree | 153 [waterfall](http://build.chromium.org/buildbot/waterfall/) is green and the tree |
| 195 is open before checking out. This will increase your chances of success. | 154 is open before checking out. This will increase your chances of success. |
| 196 | 155 |
| 197 ## Using Emacs as `EDITOR` for `git commit` | 156 ## Using Emacs as `EDITOR` for `git commit` |
| 198 | 157 |
| 199 Using the [Cocoa version of Emacs](http://emacsformacosx.com/) as the `EDITOR` | 158 Using the [Cocoa version of Emacs](http://emacsformacosx.com/) as the `EDITOR` |
| 200 environment variable on Mac OS will cause `git commit` to open the message in a | 159 environment variable on Mac OS will cause `git commit` to open the message in a |
| 201 window underneath all the others. To fix this, create a shell script somewhere | 160 window underneath all the others. To fix this, create a shell script somewhere |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 ``` | 223 ``` |
| 265 | 224 |
| 266 the Xcode license hasn't been accepted yet which (contrary to the message) any | 225 the Xcode license hasn't been accepted yet which (contrary to the message) any |
| 267 user can do by running: | 226 user can do by running: |
| 268 | 227 |
| 269 xcodebuild -license | 228 xcodebuild -license |
| 270 | 229 |
| 271 Only accepting for all users of the machine requires root: | 230 Only accepting for all users of the machine requires root: |
| 272 | 231 |
| 273 sudo xcodebuild -license | 232 sudo xcodebuild -license |
| OLD | NEW |