From 919cda539b142b51fc2ef2342dbf1803b65f5434 Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Wed, 12 Feb 2025 20:13:09 +1000
Subject: [PATCH] remoting: Linux: guard wayland includes

During the refactor in 53f3429926deb4cb92d9cddcda5fc096a0332db3
wayland support became required to build this component.

Only include wayland components in the `platform_impls` target
if `ozone_platform_wayland` is true.

Bug: 391722217
See also: https://bugs.gentoo.org/948384
Signed-off-by: Matt Jolly <kangie@gentoo.org>
--- a/remoting/host/linux/BUILD.gn
+++ b/remoting/host/linux/BUILD.gn
@@ -192,7 +192,6 @@ source_set("platform_impls") {
     "wayland_seat.h",
   ]
   deps = [
-    ":wayland",
     ":x11",
     ":x11_display_utils",
     "//base",
@@ -214,9 +213,16 @@ source_set("platform_impls") {
     "//ui/base",
     "//ui/base/x",
     "//ui/events:dom_keycode_converter",
-    "//ui/events/platform/wayland:wayland_event_watcher",
     "//ui/gfx/x",
   ]
+  # ui/events/platform/wayland:wayland_event_watcher asserts that the wayland
+  # platform is enabled.
+  if (ozone_platform_wayland) {
+    deps += [
+      ":wayland",
+      "//ui/events/platform/wayland:wayland_event_watcher",
+    ]
+  }
 }
 
 source_set("x11_display_utils") {
-- 
2.48.0