summary refs log tree commit diff
path: root/pkgs/os-specific/linux/chromium-os/sommelier/0006-sommelier-make-building-demos-optional.patch
blob: ecc876e4bfbee118db8ffcc86792631bfc19637e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 6a4ccbcded19df9ec42b865218ac744e6b35d505 Mon Sep 17 00:00:00 2001
From: Alyssa Ross <hi@alyssa.is>
Date: Wed, 15 Jan 2020 21:36:43 +0000
Subject: [PATCH 6/6] sommelier: make building demos optional
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

pkg-config was checked at GN evaluation time for libbrillo and
libchrome, meaning that there was no way to build sommelier without
them, even though they were only required for the demos, not for
sommelier itself.

Making the demo optional saves having to libbrillo and libchrome for
the common case of building just sommelier, which themselves have lots
of unusual dependencies.

Thanks-to: Tomasz Śniatowski <tsniatowski@vewd.com>
---
 vm_tools/sommelier/BUILD.gn | 54 ++++++++++++++++++++++---------------
 1 file changed, 32 insertions(+), 22 deletions(-)

diff --git a/vm_tools/sommelier/BUILD.gn b/vm_tools/sommelier/BUILD.gn
index 4330560a1..cbb752745 100644
--- a/vm_tools/sommelier/BUILD.gn
+++ b/vm_tools/sommelier/BUILD.gn
@@ -4,12 +4,20 @@
 
 import("wayland_protocol.gni")
 
+declare_args() {
+  use_demos = true
+}
+
 group("all") {
   deps = [
     ":sommelier",
-    ":wayland_demo",
-    ":x11_demo",
   ]
+  if (use_demos) {
+    deps += [
+      ":wayland_demo",
+      ":x11_demo",
+    ]
+  }
 }
 
 if (!defined(peer_cmd_prefix)) {
@@ -123,25 +131,27 @@ executable("sommelier") {
   ]
 }
 
-executable("wayland_demo") {
-  pkg_deps = [
-    "libbrillo",
-    "libchrome-${libbase_ver}",
-    "wayland-client",
-  ]
-  libs = [ "wayland-client" ]
-  sources = [
-    "demos/wayland_demo.cc",
-  ]
-}
+if (use_demos) {
+  executable("wayland_demo") {
+    pkg_deps = [
+      "libbrillo",
+      "libchrome-${libbase_ver}",
+      "wayland-client",
+    ]
+    libs = [ "wayland-client" ]
+    sources = [
+      "demos/wayland_demo.cc",
+    ]
+  }
 
-executable("x11_demo") {
-  pkg_deps = [
-    "libbrillo",
-    "libchrome-${libbase_ver}",
-  ]
-  libs = [ "X11" ]
-  sources = [
-    "demos/x11_demo.cc",
-  ]
+  executable("x11_demo") {
+    pkg_deps = [
+      "libbrillo",
+      "libchrome-${libbase_ver}",
+    ]
+    libs = [ "X11" ]
+    sources = [
+      "demos/x11_demo.cc",
+    ]
+  }
 }
-- 
2.26.2