Commit Graph

1 Commits

Author SHA1 Message Date
Elie Michel 9ae8ed2f62 Add fetch_dawn_dependencies
This adds a DAWN_FETCH_DEPENDENCIES CMake option (default: OFF) that if
turned ON fetches dependencies using a basic Python script that reads
DEPS files instead of requiring the installation of depot_tools by all
projects that depend on Dawn.

The script is not equivalent to gclient as it is not aware of advanced
configuration options (it always gets the list of dependencies that is
hardcoded at the beginning) but at least for a regular use of Dawn as a
dependency that provides a WebGPU backend (the intended use of this
DAWN_FETCH_DEPENDENCIES option) it is enough.

This is an attempt at merging upstream [this
repository](https://github.com/eliemichel/WebGPU-distribution/tree/dawn)
that I currently recommend in [Learn WebGPU for native
C++](https://eliemichel.github.io/LearnWebGPU/getting-started/hello-webgpu.html)
as a shallow intermediary to avoid requiring depot_tools (and turn some
options on/off).

By default, the script performs shallow clones, getting only the very
commit that is needed. This is a great improvement over naive clone:

                | Regular | Shallow |
----------------|---------|---------|
Downloaded size |  194 MB |  15 MB  |
Stored size     |  294 MB | 103 MB  |

Change-Id: Iaedb4af78036a1696b68787c36f1d3d70e18ba2c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131750
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-05-12 20:19:41 +00:00