Building Dawn Samples

System requirements

  • Git
  • CMake (3.10.2 or later) (if desired)
  • Python, for fetching dependencies
  • 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

Get the code and its dependencies

Use tools/ to clone the dependencies' repositories:

# Clone the repo as "dawn"
git clone dawn-samples && cd dawn-samples

# Fetch dependencies (lose equivalent of gclient sync)
python tools/

Use python tools/ -h to know more about the available options. Contrary to depot_tools, this scripts does not figure out option-dependent requirements automatically.

TODO: Dawn samples do not yet support using the Chromium build system.

Build Dawn Samples

Compiling using CMake + make

mkdir -p out/Debug
cd out/Debug
cmake ../..
make # -j N for N-way parallel build