Only build "common" on supported systems

src/common/BUILD.gn contains common dawn configs and will be discovered
by all Chromium builds. "common" doesn't build on all system, for
example Fuchsia so we only expose the target if we are on a supported
system.

BUG=dawn:61

Change-Id: Ib12b1bd3e32529e1969fdc2fc50af05f8e97e7df
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5360
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn
index 3140b71..58b60f2 100644
--- a/src/common/BUILD.gn
+++ b/src/common/BUILD.gn
@@ -71,30 +71,35 @@
 # Common dawn library
 ###############################################################################
 
-static_library("common") {
-  sources = [
-    "Assert.cpp",
-    "Assert.h",
-    "BitSetIterator.h",
-    "Compiler.h",
-    "DynamicLib.cpp",
-    "DynamicLib.h",
-    "HashUtils.h",
-    "Math.cpp",
-    "Math.h",
-    "Platform.h",
-    "Result.h",
-    "Serial.h",
-    "SerialMap.h",
-    "SerialQueue.h",
-    "SerialStorage.h",
-    "SwapChainUtils.h",
-    "vulkan_platform.h",
-    "windows_with_undefs.h",
-  ]
-
-  configs += [ ":dawn_internal" ]
-  deps = [
-    "${dawn_root}/src/dawn:dawn_headers",
-  ]
+# This GN file is discovered by all Chromium builds, but common doesn't support
+# all of Chromium's OSes so we explicitly make the target visible only on
+# systems we know Dawn is able to compile on.
+if (is_win || is_linux || is_mac) {
+  static_library("common") {
+    sources = [
+      "Assert.cpp",
+      "Assert.h",
+      "BitSetIterator.h",
+      "Compiler.h",
+      "DynamicLib.cpp",
+      "DynamicLib.h",
+      "HashUtils.h",
+      "Math.cpp",
+      "Math.h",
+      "Platform.h",
+      "Result.h",
+      "Serial.h",
+      "SerialMap.h",
+      "SerialQueue.h",
+      "SerialStorage.h",
+      "SwapChainUtils.h",
+      "vulkan_platform.h",
+      "windows_with_undefs.h",
+    ]
+  
+    configs += [ ":dawn_internal" ]
+    deps = [
+      "${dawn_root}/src/dawn:dawn_headers",
+    ]
+  }
 }