GN: Wayland build overrides

Introduce //build_overrides/wayland.gni to simplify the management of
the wayland dependencies in Chromium, ANGLE, and SwiftShader.

Bug: 1327041, angleproject:7409
Change-Id: Ia178f09303c772a5cce5f9c6b93a4ef2a9381102
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3695277
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013661}
NOKEYCHECK=True
GitOrigin-RevId: 3d415c7d0eba78f0b18e2c1fe1e84e4afa7e66e2
diff --git a/angle.gni b/angle.gni
index 2879e29..96f0044 100644
--- a/angle.gni
+++ b/angle.gni
@@ -18,3 +18,4 @@
 angle_spirv_headers_dir = "//third_party/vulkan-deps/spirv-headers/src"
 angle_spirv_tools_dir = "//third_party/vulkan-deps/spirv-tools/src"
 angle_vulkan_memory_allocator_dir = "//third_party/vulkan_memory_allocator"
+angle_wayland_dir = "//third_party/wayland/src"
diff --git a/vulkan_headers.gni b/vulkan_headers.gni
index 37e67a8..eb52962 100644
--- a/vulkan_headers.gni
+++ b/vulkan_headers.gni
@@ -3,19 +3,18 @@
 # found in the LICENSE file.
 
 import("//build/config/ozone.gni")
+import("//build_overrides/wayland.gni")
 
 vulkan_use_x11 = ozone_platform_x11
 
 if (ozone_platform_wayland) {
   vulkan_use_wayland = true
 
-  import("//third_party/wayland/features.gni")
   if (!use_system_libwayland) {
-    wayland_dir = "//third_party/wayland"
     vulkan_wayland_include_dirs = [
-      "$wayland_dir/src/src",
-      "$wayland_dir/include/src",
-      "$wayland_dir/include/protocol",
+      "$wayland_gn_dir/src/src",
+      "$wayland_gn_dir/include/src",
+      "$wayland_gn_dir/include/protocol",
     ]
   }
 }
diff --git a/wayland.gni b/wayland.gni
new file mode 100644
index 0000000..0d48c7e
--- /dev/null
+++ b/wayland.gni
@@ -0,0 +1,17 @@
+# Copyright 2022 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ozone.gni")
+
+wayland_gn_dir = "//third_party/wayland"
+
+if (ozone_platform_wayland) {
+  # This defines use_system_libwayland
+  import("$wayland_gn_dir/features.gni")
+} else {
+  use_system_libwayland = false
+}
+
+# Path to Wayland sources
+wayland_dir = "$wayland_gn_dir/src"