Guard dbus component and config with assert(use_dbus)
Often times dbus dependencies get added without proper guards.
By guarding the component with assert(use_dbus) it forces proper guarding
when depending on dbus. This prevents downstream breakages in
chromecast.
BUG=internal b/28962923
Review-Url: https://codereview.chromium.org/2009983002
Cr-Commit-Position: refs/heads/master@{#396948}
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
index beb0f01..537af73c 100644
--- a/chrome/browser/extensions/BUILD.gn
+++ b/chrome/browser/extensions/BUILD.gn
@@ -99,7 +99,9 @@
".",
"//chrome")
sources -= [ "api/music_manager_private/device_id_linux.cc" ]
- configs += [ "//build/config/linux/dbus" ]
+ if (use_dbus) {
+ configs += [ "//build/config/linux/dbus" ]
+ }
deps += [
"//components/chrome_apps",
"//remoting/host/it2me:common",
@@ -143,10 +145,12 @@
}
if (is_linux) {
- deps += [
- "//build/linux:fontconfig",
- "//dbus",
- ]
+ deps += [ "//build/linux:fontconfig" ]
+
+ if (use_dbus) {
+ deps += [ "//dbus" ]
+ }
+
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
deps += [