The meson recipes will need to link against libvirt.so,
libvirt-admin.so and libgnu.a. We declare these as
external pre-built dependencies for now.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
meson.build | 13 +++++++++++++
src/meson.build | 25 +++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 src/meson.build
diff --git a/meson.build b/meson.build
index 31428dba9b..1febd9c35d 100644
--- a/meson.build
+++ b/meson.build
@@ -19,4 +19,17 @@ local_state_dir = get_option('localstatedir')
pkg_data_dir = data_dir / meson.project_name()
pkg_doc_dir = data_dir / 'doc' / meson.project_name() + '-' +
meson.project_version()
+public_inc_dir = include_directories('include')
+gnulib_inc_dir = include_directories('gnulib/lib')
+
+cc = meson.get_compiler('c')
+
+gnulib = cc.find_library('libgnu', dirs: [meson.build_root() / 'gnulib' /
'lib' / '.libs'])
+gnulib_dep = declare_dependency(
+ dependencies: [gnulib],
+ include_directories: [gnulib_inc_dir]
+)
+
meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(),
meson.build_root())
+
+subdir('src')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000000..a86d3a6980
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,25 @@
+
+libvirt = cc.find_library('libvirt', dirs: [meson.build_root() / 'src' /
'.libs'])
+libvirt_admin = cc.find_library('libvirt-admin', dirs: [meson.build_root() /
'src' / '.libs'])
+libvirt_qemu = cc.find_library('libvirt-qemu', dirs: [meson.build_root() /
'src' / '.libs'])
+libvirt_lxc = cc.find_library('libvirt-lxc', dirs: [meson.build_root() /
'src' / '.libs'])
+
+libvirt_dep = declare_dependency(
+ dependencies: libvirt,
+ include_directories: [public_inc_dir]
+)
+
+libvirt_admin_dep = declare_dependency(
+ dependencies: libvirt_admin,
+ include_directories: [public_inc_dir]
+)
+
+libvirt_qemu_dep = declare_dependency(
+ dependencies: libvirt_qemu,
+ include_directories: [public_inc_dir]
+)
+
+libvirt_lxc_dep = declare_dependency(
+ dependencies: libvirt_lxc,
+ include_directories: [public_inc_dir]
+)
--
2.21.0