blob: baf9941e1916957524385145c2104bd71c8642c2 [file] [log] [blame] [view]
dpranke1a70d0c2016-12-01 02:42:291# Checking out and building Chromium for Mac
andybons3322f762015-08-24 21:37:092
erikchen7d7509a2017-10-02 23:40:363There are instructions for other platforms linked from the
dpranke1a70d0c2016-12-01 02:42:294[get the code](get_the_code.md) page.
5
dpranke1a70d0c2016-12-01 02:42:296## Instructions for Google Employees
7
8Are you a Google employee? See
9[go/building-chrome](https://goto.google.com/building-chrome) instead.
dpranke0ae7cad2016-11-30 07:47:5810
andybonsad92aa32015-08-31 02:27:4411[TOC]
andybons3322f762015-08-24 21:37:0912
dpranke0ae7cad2016-11-30 07:47:5813## System requirements
sdya8197bd22016-09-14 19:06:4214
Nico Weber3c9befa2021-11-03 17:07:1115* A Mac, Intel or Arm.
Avi Drissmanab7729b2021-06-10 19:17:1516 ([More details about Arm Macs](https://chromium.googlesource.com/chromium/src.git/+/main/docs/mac_arm64.md).)
Nico Weber3c9befa2021-11-03 17:07:1117* [Xcode](https://developer.apple.com/xcode/). Xcode comes with...
18* The macOS SDK. Run
sdy93387fa2016-12-01 01:03:4419
erikchen7d7509a2017-10-02 23:40:3620 ```shell
sdy93387fa2016-12-01 01:03:4421 $ ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
dominicca4e4c992016-05-23 22:08:0322 ```
erikchen7d7509a2017-10-02 23:40:3623
Nico Weber3c9befa2021-11-03 17:07:1124 to check whether you have it, and what version you have.
25 `mac_sdk_official_version` in [mac_sdk.gni](../build/config/mac/mac_sdk.gni)
26 is the SDK version used on all the bots and for
27 [official builds](https://source.chromium.org/search?q=MAC_BINARIES_LABEL&ss=chromium),
28 so that version is guaranteed to work. Building with a newer SDK usually
29 works too (please fix or file a bug if it doesn't).
wafuwafu13b6854ba52021-12-24 06:02:4330
Nico Weber3c9befa2021-11-03 17:07:1131 Building with an older SDK might also work, but if it doesn't then we won't
32 accept changes for making it work.
wafuwafu13b6854ba52021-12-24 06:02:4333
Nico Weber3c9befa2021-11-03 17:07:1134 The easiest way to get the newest SDK is to use the newest version of Xcode,
35 which often requires using the newest version of macOS. We don't use Xcode
36 itself much, so if you're know what you're doing, you can likely get the
37 build working with an older version of macOS as long as you get a new
38 version of the macOS SDK on it.
Nico Weber36cd0a552022-01-18 16:31:4939* An APFS-formatted volume (this is the default format for macOS volumes).
andybons3322f762015-08-24 21:37:0940
dpranke0ae7cad2016-11-30 07:47:5841## Install `depot_tools`
andybons3322f762015-08-24 21:37:0942
sdy93387fa2016-12-01 01:03:4443Clone the `depot_tools` repository:
andybons3322f762015-08-24 21:37:0944
sdy93387fa2016-12-01 01:03:4445```shell
46$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
47```
andybons3322f762015-08-24 21:37:0948
Gabriel Charetteb6780c12019-04-24 16:23:5249Add `depot_tools` to the end of your PATH (you will probably want to put this in
50your `~/.bash_profile` or `~/.zshrc`). Assuming you cloned `depot_tools` to
51`/path/to/depot_tools` (note: you **must** use the absolute path or Python will
52not be able to find infra tools):
dpranke0ae7cad2016-11-30 07:47:5853
sdy93387fa2016-12-01 01:03:4454```shell
55$ export PATH="$PATH:/path/to/depot_tools"
56```
dpranke0ae7cad2016-11-30 07:47:5857
58## Get the code
59
sdy93387fa2016-12-01 01:03:4460Create a `chromium` directory for the checkout and change to it (you can call
61this whatever you like and put it wherever you like, as long as the full path
62has no spaces):
dpranke0ae7cad2016-11-30 07:47:5863
sdy93387fa2016-12-01 01:03:4464```shell
65$ mkdir chromium && cd chromium
66```
67
68Run the `fetch` tool from `depot_tools` to check out the code and its
dpranke0ae7cad2016-11-30 07:47:5869dependencies.
70
sdy93387fa2016-12-01 01:03:4471```shell
David Sanderse3827172022-02-08 15:48:5672$ caffeinate fetch chromium
sdy93387fa2016-12-01 01:03:4473```
dpranke0ae7cad2016-11-30 07:47:5874
David Sanderse3827172022-02-08 15:48:56