Commit Graph

4 Commits

Author SHA1 Message Date
Corentin Wallez c48e487998 Avoid unnecessary recompiles with code generators.
Previously code generators would unconditionally write the generated
files even if they didn't change, causing all many more files to be
rebuilt than necessary.

Make extract_json.py check the file content to skip writing if it can to
fix this.

Bug: None
Change-Id: I22389444179c9b16a7ccc03ea133a973d419fad3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45761
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-03-23 19:06:02 +00:00
Corentin Wallez 59382b7d3f Use python3 for all of Dawn's python scripts
Bug: dawn:389
Change-Id: I5034ab2791f0cca0b7690eae5f4d7f4e6efc4bd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19863
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-04-17 20:43:07 +00:00
Reid Kleckner 48e7da791f Use dict.items() instead of dict.iteritems() for py3 compat
iteritems() went away in Python 3.

R=kainino@chromium.org

Bug: 941669
Change-Id: I0c107aaa35bb1df7c126485c33c3d15cb77f03fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15560
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-01-30 01:25:08 +00:00
Corentin Wallez 59e7fad99b BUILD.gn: Remove use of exec_script
Chromium's BUILD files try to avoid uses of exec_script when possible
because they slow down every GN invocation. In preparation for building
Dawn inside Chromium, the calls to exec_script for the code generator
are removed.

In GN, the generator now outputs a "JSON tarball", a dictionnary mapping
filenames to content. This allows us to use the "depfile" feature of GN
to avoid the exec_script call to gather the script's inputs.

Outputs of the generator are now listed in the BUILD.gn files. To keep
it in sync with the generator, GN outputs a file containing "expected
outputs" that is checked by the code generator.

Finally the dawn_generator GN template doesn't create a target anymore,
but users are expected to gather outputs using get_target_outputs.
2018-08-20 07:24:55 -04:00