OLD | NEW |
1 # Mac Build Instructions | 1 # Checking out and building Chromium for Mac |
2 | 2 |
3 Google employee? See [go/building-chrome](https://goto.google.com/building-chrom
e) instead. | 3 There are instructions for other platforms linked from the |
| 4 [get the code](get_the_code.md) page. |
| 5 |
| 6 **See also [the old version of this page](old_mac_build_instructions.md).** |
| 7 |
| 8 ## Instructions for Google Employees |
| 9 |
| 10 Are you a Google employee? See |
| 11 [go/building-chrome](https://goto.google.com/building-chrome) instead. |
4 | 12 |
5 [TOC] | 13 [TOC] |
6 | 14 |
7 ## System requirements | 15 ## System requirements |
8 | 16 |
9 * A 64-bit Mac running 10.9+. | 17 * A 64-bit Mac running 10.9+. |
10 * [Xcode](https://developer.apple.com/xcode) 7.3+. | 18 * [Xcode](https://developer.apple.com/xcode) 7.3+. |
11 * The OS X 10.10 SDK. Run | 19 * The OS X 10.10 SDK. Run |
12 | 20 |
13 ```shell | 21 ```shell |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 70 |
63 ```shell | 71 ```shell |
64 $ cd src | 72 $ cd src |
65 ``` | 73 ``` |
66 | 74 |
67 *Optional*: You can also [install API | 75 *Optional*: You can also [install API |
68 keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your | 76 keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your |
69 build to talk to some Google services, but this is not necessary for most | 77 build to talk to some Google services, but this is not necessary for most |
70 development and testing purposes. | 78 development and testing purposes. |
71 | 79 |
72 ## Building | 80 ## Setting up the build |
73 | 81 |
74 Chromium uses [Ninja](https://ninja-build.org) as its main build tool along | 82 Chromium uses [Ninja](https://ninja-build.org) as its main build tool along |
75 with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` | 83 with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` |
76 files. You can create any number of *build directories* with different | 84 files. You can create any number of *build directories* with different |
77 configurations. To create a build directory: | 85 configurations. To create a build directory: |
78 | 86 |
79 ```shell | 87 ```shell |
80 $ gn gen out/Default | 88 $ gn gen out/Default |
81 ``` | 89 ``` |
82 | 90 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 ``` | 129 ``` |
122 symbol_level = 0 | 130 symbol_level = 0 |
123 ``` | 131 ``` |
124 | 132 |
125 in your args.gn to disable debug symbols altogether. This makes both full | 133 in your args.gn to disable debug symbols altogether. This makes both full |
126 rebuilds and linking faster (at the cost of not getting symbolized backtraces | 134 rebuilds and linking faster (at the cost of not getting symbolized backtraces |
127 in gdb). | 135 in gdb). |
128 | 136 |
129 You might also want to [install ccache](ccache_mac.md) to speed up the build. | 137 You might also want to [install ccache](ccache_mac.md) to speed up the build. |
130 | 138 |
| 139 ## Build Chromium |
| 140 |
| 141 Build Chromium (the "chrome" target) with Ninja using the command: |
| 142 |
| 143 ```shell |
| 144 $ ninja -C out/Default chrome |
| 145 ``` |
| 146 |
| 147 You can get a list of all of the other build targets from GN by running `gn ls |
| 148 out/Default` from the command line. To compile one, pass the GN label to Ninja |
| 149 with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C |
| 150 out/Default chrome/test:unit_tests`). |
| 151 |
131 ## Run Chromium | 152 ## Run Chromium |
132 | 153 |
133 Once it is built, you can simply run the browser: | 154 Once it is built, you can simply run the browser: |
134 | 155 |
135 ```shell | 156 ```shell |
136 $ out/Default/chrome | 157 $ out/Default/chrome |
137 ``` | 158 ``` |
138 | 159 |
139 ## Running test targets | 160 ## Running test targets |
140 | 161 |
141 You can run the tests in the same way. You can also limit which tests are | 162 You can run the tests in the same way. You can also limit which tests are |
142 run using the `--gtest_filter` arg, e.g.: | 163 run using the `--gtest_filter` arg, e.g.: |
143 | 164 |
144 ``` | 165 ``` |
145 $ ninja -C out/Default unit_tests --gtest_filter="PushClientTest.*" | 166 $ out/Default/unit_tests --gtest_filter="PushClientTest.*" |
146 ``` | 167 ``` |
147 | 168 |
148 You can find out more about GoogleTest at its | 169 You can find out more about GoogleTest at its |
149 [GitHub page](https://github.com/google/googletest). | 170 [GitHub page](https://github.com/google/googletest). |
150 | 171 |
151 ## Debugging | 172 ## Debugging |
152 | 173 |
153 Good debugging tips can be found | 174 Good debugging tips can be found |
154 [here](http://dev.chromium.org/developers/how-tos/debugging-on-os-x). If you | 175 [here](http://dev.chromium.org/developers/how-tos/debugging-on-os-x). If you |
155 would like to debug in a graphical environment, rather than using `lldb` at the | 176 would like to debug in a graphical environment, rather than using `lldb` at the |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 278 |
258 ```shell | 279 ```shell |
259 $ xcodebuild -license | 280 $ xcodebuild -license |
260 ``` | 281 ``` |
261 | 282 |
262 Only accepting for all users of the machine requires root: | 283 Only accepting for all users of the machine requires root: |
263 | 284 |
264 ```shell | 285 ```shell |
265 $ sudo xcodebuild -license | 286 $ sudo xcodebuild -license |
266 ``` | 287 ``` |
OLD | NEW |