patches and low-level development discussion
 help / color / mirror / code / Atom feed
3538932d804edd6110afcb13d495d80e0eef4335 blob 2232 bytes (raw)

  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 8774d76f1b57092df9004d654fd075d7691b9f12 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/7] 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

debug log:

solving 3538932d804 ...
found 3538932d804 in https://spectrum-os.org/git/nixpkgs

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).