1# Building Dawn 2 3## System requirements 4 5- Linux 6 - The `pkg-config` command: 7 ```sh 8 # Install pkg-config on Ubuntu 9 sudo apt-get install pkg-config 10 ``` 11 12- Mac 13 - [Xcode](https://developer.apple.com/xcode/) 12.2+. 14 - The macOS 11.0 SDK. Run `xcode-select` to check whether you have it. 15 ```sh 16 ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs 17 ``` 18 19## Install `depot_tools` 20 21Dawn uses the Chromium build system and dependency management so you need to [install depot_tools] and add it to the PATH. 22 23[install depot_tools]: http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up 24 25## Get the code 26 27```sh 28# Clone the repo as "dawn" 29git clone https://dawn.googlesource.com/dawn dawn && cd dawn 30 31# Bootstrap the gclient configuration 32cp scripts/standalone.gclient .gclient 33 34# Fetch external dependencies and toolchains with gclient 35gclient sync 36``` 37 38## Build Dawn 39 40Then generate build files using `gn args out/Debug` or `gn args out/Release`. 41A text editor will appear asking build options, the most common option is `is_debug=true/false`; otherwise `gn args out/Release --list` shows all the possible options. 42 43On macOS you'll want to add the `use_system_xcode=true` in most cases. (and if you're a googler please get XCode from go/xcode). 44 45Then use `ninja -C out/Release` to build dawn and for example `./out/Release/dawn_end2end_tests` to run the tests. 46 47