dawn-cmake/docs/dawn/building.md
Ben Clayton 26c31f6b2c Shuffle 'docs' directories
As part of the tint -> dawn merge.

Bug: dawn:1275
Change-Id: Ice0c9d2f03f6d7e96471cf8398aecd16273c833f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-01-27 18:33:47 +00:00

1.4 KiB

Building Dawn

System requirements

  • Linux

    • The pkg-config command:
      # Install pkg-config on Ubuntu
      sudo apt-get install pkg-config
      
  • Mac

    • Xcode 12.2+.
    • The macOS 11.0 SDK. Run xcode-select to check whether you have it.
      ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs
      

Install depot_tools

Dawn uses the Chromium build system and dependency management so you need to install depot_tools and add it to the PATH.

Get the code

# Clone the repo as "dawn"
git clone https://dawn.googlesource.com/dawn dawn && cd dawn

# Bootstrap the gclient configuration
cp scripts/standalone.gclient .gclient

# Fetch external dependencies and toolchains with gclient
gclient sync

Build Dawn

Then generate build files using gn args out/Debug or gn args out/Release. A 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.

On 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).

Then use ninja -C out/Release to build dawn and for example ./out/Release/dawn_end2end_tests to run the tests.