]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: src: add support for building helpers
authorPavel Hrdina <phrdina@redhat.com>
Wed, 6 May 2020 08:37:21 +0000 (10:37 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:05 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/meson.build

index 24d454946d7e1d0d90fc9083b713cad123c48aed..b7679557b3f22ffbc947ad3a96e1c0c640c83a36 100644 (file)
@@ -148,6 +148,16 @@ virt_modules = []
 #   * include = include_directories (optional, default [])
 virt_daemons = []
 
+# virt_helpers:
+#   each entry is a dictionary with following items:
+#   * name - binary name (required)
+#   * sources - binary sources (required)
+#   * c_args - compile arguments (optional, default [])
+#   * include - include_directories (optional, default [])
+#   * deps - dependencies (optional, default [])
+#   * install_dir - installation directory (optional, libexecdir)
+virt_helpers = []
+
 
 # list subdirectories
 
@@ -528,3 +538,31 @@ foreach daemon : virt_daemons
     install_rpath: libdir,
   )
 endforeach
+
+
+# build libvirt helpers
+
+foreach helper : virt_helpers
+  bin = executable(
+    helper['name'],
+    [
+      helper['sources'],
+    ],
+    c_args: [
+      helper.get('c_args', []),
+    ],
+    include_directories: [
+      helper.get('include', []),
+    ],
+    dependencies: [
+      src_dep,
+      helper.get('deps', []),
+    ],
+    link_with: [
+      libvirt_lib,
+    ],
+    install: true,
+    install_dir: helper.get('install_dir', libexecdir),
+    install_rpath: libdir,
+  )
+endforeach