build: assert use_dawn

This will help flush out future errors where targets depend on this
target in configs where it won't build or isn't used.

Bug: None
Change-Id: Iebfc6b9afbd9b4fd9616d87bcaf8cd83a2163777
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13620
Commit-Queue: Elly Fong-Jones <ellyjones@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 99742ed..2da23a1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -21,6 +21,13 @@
 
 import("//testing/test.gni")
 
+if (build_with_chromium) {
+  # Chromium build targets may not depend on dawn unless use_dawn is set. This
+  # assertion helps avoid accidental dependencies creeping into chromium.
+  import("//ui/gl/features.gni")
+  assert(use_dawn)
+}
+
 ###############################################################################
 # dawn_platform
 ###############################################################################