dawn_features.gni: add an option to complete static libraries

This is useful for people using Dawn's standalone build to compile
static libraries to use in other projects. Without this static libraries
will act as source sets as is GN's default.

BUG=dawn:85

Change-Id: I4d99cbbbe67c73f226717651cb12ed0a172409b2
Reviewed-on: https://dawn-review.googlesource.com/c/3840
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index b0d9468..5d61bc1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -216,6 +216,8 @@
   static_library("${libname}_static") {
     output_name = libname
 
+    complete_static_lib = dawn_complete_static_libs
+
     # Copy all variables except "configs", which has a default value
     forward_variables_from(invoker, "*", [ "configs" ])
     if (defined(invoker.configs)) {
diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni
index 031cdb1..d86f218 100644
--- a/scripts/dawn_features.gni
+++ b/scripts/dawn_features.gni
@@ -16,6 +16,11 @@
   # Enable Dawn's ASSERTs even in release builds
   dawn_always_assert = false
 
+  # Should the Dawn static libraries be fully linked vs. GN's default of
+  # treating them as source sets. This is useful for people using Dawn
+  # standalone to produce static libraries to use in their projects.
+  dawn_complete_static_libs = false
+
   # Enables the compilation of Dawn's D3D12 backend
   dawn_enable_d3d12 = is_win