[dawn] Add fuzzers to dawn_maximal

Unfortunately there's no way to enable fuzzers automatically, so instead
just require use_libfuzzer to also be enabled.

Also allow dawn.node to be built even when fuzzers are enabled. This
seems to still build and run fine.

Note that dawn_maximal is currently only for local development and
doesn't affect what we build on CQ (yet).

Bug: 561317338, 553115993
Change-Id: I8b61a4e2aebe597459a86936a77092d43b0a6ba7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/342235
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index b6ff8eb..eec4d61 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -59,9 +59,6 @@
       assert(
           dawn_node,
           "dawn_build_node_bindings requires dawn_node to be set in .gclient")
-      assert(
-          !defined(use_libfuzzer) || !use_libfuzzer,
-          "Building dawn node bindings with use_libfuzzer currently not supported")
       deps += [ "src/dawn/node:dawn_node" ]
     }
   }
diff --git a/docs/development-tips.md b/docs/development-tips.md
index 13cfbb0..189d156 100644
--- a/docs/development-tips.md
+++ b/docs/development-tips.md
@@ -8,8 +8,8 @@
 Especially useful for any change or refactor that affects multiple backends.
 
 - Use `scripts/standalone-maximal.gclient` instead of `standalone.gclient`.
-- Set the `dawn_maximal = true` GN arg to default to building as many targets
-  as possible given your host OS.
+- Set the `dawn_maximal = true` and `use_libfuzzer = true` GN args to default to
+  building as many targets as possible given your host OS.
 - Build all targets (target `all`, which is the default if none is specified).
 - Develop on Linux or Mac, and set up build directories that cross-compile for
   other OSes (see [building.md](building.md)).
diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni
index b443750..084029b 100644
--- a/scripts/dawn_features.gni
+++ b/scripts/dawn_features.gni
@@ -26,6 +26,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import("//build/config/clang/clang.gni")
+import("//build/config/sanitizers/sanitizers.gni")
 import("//build_overrides/build.gni")
 import("dawn_overrides_with_defaults.gni")
 
@@ -35,6 +36,12 @@
   dawn_maximal = false
 }
 
+if (dawn_maximal && !is_wasm) {
+  assert(
+      use_libfuzzer,
+      "dawn_maximal=true also requires use_libfuzzer=true to build fuzzer targets")
+}
+
 declare_args() {
   # Enable building with a warning allowlist (-Weverything -Wno-...).
   # Default to enabled if using clang and is dawn standalone build.
@@ -43,7 +50,6 @@
 
 if (build_with_chromium) {
   import("//build/config/ozone.gni")
-  import("//build/config/sanitizers/sanitizers.gni")
 
   dawn_use_x11 = ozone_platform_x11
   dawn_use_wayland = false