The example programs link against the main libvirt.so,
which is not yet built by meson. Thus we declare it
as an external dependancy initially.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
examples/Makefile.am | 52 -----------------------------------
examples/c/admin/meson.build | 51 ++++++++++++++++++++++++++++++++++
examples/c/domain/meson.build | 37 +++++++++++++++++++++++++
examples/c/meson.build | 4 +++
examples/c/misc/meson.build | 23 ++++++++++++++++
examples/meson.build | 2 ++
meson.build | 1 +
7 files changed, 118 insertions(+), 52 deletions(-)
create mode 100644 examples/c/admin/meson.build
create mode 100644 examples/c/domain/meson.build
create mode 100644 examples/c/meson.build
create mode 100644 examples/c/misc/meson.build
create mode 100644 examples/meson.build
diff --git a/examples/Makefile.am b/examples/Makefile.am
index ad635bdcc0..b12652874f 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -56,58 +56,6 @@ EXTRA_DIST = \
$(TEST_XML_EXAMPLES) \
$(NULL)
-AM_CPPFLAGS = \
- -I$(top_builddir)/include \
- -I$(top_srcdir)/include \
- $(NULL)
-
-AM_CFLAGS = \
- $(WARN_CFLAGS) \
- $(NULL)
-
-AM_LDFLAGS = \
- $(STATIC_BINARIES) \
- $(NULL)
-
-LDADD = \
- $(top_builddir)/src/libvirt.la \
- $(top_builddir)/src/libvirt-admin.la \
- $(NULL)
-
-noinst_PROGRAMS = \
- c/admin/client_close \
- c/admin/client_info \
- c/admin/client_limits \
- c/admin/list_clients \
- c/admin/list_servers \
- c/admin/logging \
- c/admin/threadpool_params \
- c/domain/dommigrate \
- c/domain/domtop \
- c/domain/info1 \
- c/domain/rename \
- c/domain/suspend \
- c/misc/event-test \
- c/misc/hellolibvirt \
- c/misc/openauth \
- $(NULL)
-
-c_admin_client_close_SOURCES = c/admin/client_close.c
-c_admin_client_info_SOURCES = c/admin/client_info.c
-c_admin_client_limits_SOURCES = c/admin/client_limits.c
-c_admin_list_clients_SOURCES = c/admin/list_clients.c
-c_admin_list_servers_SOURCES = c/admin/list_servers.c
-c_admin_logging_SOURCES = c/admin/logging.c
-c_admin_threadpool_params_SOURCES = c/admin/threadpool_params.c
-c_domain_dommigrate_SOURCES = c/domain/dommigrate.c
-c_domain_domtop_SOURCES = c/domain/domtop.c
-c_domain_info1_SOURCES = c/domain/info1.c
-c_domain_rename_SOURCES = c/domain/rename.c
-c_domain_suspend_SOURCES = c/domain/suspend.c
-c_misc_event_test_SOURCES = c/misc/event-test.c
-c_misc_hellolibvirt_SOURCES = c/misc/hellolibvirt.c
-c_misc_openauth_SOURCES = c/misc/openauth.c
-
examplesdir = $(docdir)/examples
adminexamplesdir = $(examplesdir)/c/admin
diff --git a/examples/c/admin/meson.build b/examples/c/admin/meson.build
new file mode 100644
index 0000000000..bdec5fd22e
--- /dev/null
+++ b/examples/c/admin/meson.build
@@ -0,0 +1,51 @@
+
+examples_admin_deps = [libvirt_dep, libvirt_admin_dep]
+
+client_close_src = ['client_close.c']
+client_close = executable(
+ 'client_close',
+ client_close_src,
+ dependencies: examples_admin_deps
+)
+
+client_info_src = ['client_info.c']
+client_info = executable(
+ 'client_info',
+ client_info_src,
+ dependencies: examples_admin_deps
+)
+
+client_limits_src = ['client_limits.c']
+client_limits = executable(
+ 'client_limits',
+ client_limits_src,
+ dependencies: examples_admin_deps
+)
+
+list_clients_src = ['list_clients.c']
+list_clients = executable(
+ 'list_clients',
+ list_clients_src,
+ dependencies: examples_admin_deps
+)
+
+list_server_src = ['list_servers.c']
+list_servers = executable(
+ 'list_servers',
+ list_server_src,
+ dependencies: examples_admin_deps
+)
+
+logging_src = ['logging.c']
+logging = executable(
+ 'logging',
+ logging_src,
+ dependencies: examples_admin_deps
+)
+
+threadpool_params_src = ['threadpool_params.c']
+threadpool_params = executable(
+ 'threadpool_params',
+ threadpool_params_src,
+ dependencies: examples_admin_deps
+)
diff --git a/examples/c/domain/meson.build b/examples/c/domain/meson.build
new file mode 100644
index 0000000000..8e9336b150
--- /dev/null
+++ b/examples/c/domain/meson.build
@@ -0,0 +1,37 @@
+
+examples_domain_deps = [libvirt_dep]
+
+dommigrate_src = ['dommigrate.c']
+dommigrate = executable(
+ 'dommigrate',
+ dommigrate_src,
+ dependencies: examples_domain_deps
+)
+
+domtop_src = ['domtop.c']
+domtop = executable(
+ 'domtop',
+ domtop_src,
+ dependencies: examples_domain_deps
+)
+
+info1_src = ['info1.c']
+info1 = executable(
+ 'info1',
+ info1_src,
+ dependencies: examples_domain_deps
+)
+
+rename_src = ['rename.c']
+rename = executable(
+ 'rename',
+ rename_src,
+ dependencies: examples_domain_deps
+)
+
+suspend_src = ['suspend.c']
+suspend = executable(
+ 'suspend',
+ suspend_src,
+ dependencies: examples_domain_deps
+)
diff --git a/examples/c/meson.build b/examples/c/meson.build
new file mode 100644
index 0000000000..3a93ccd033
--- /dev/null
+++ b/examples/c/meson.build
@@ -0,0 +1,4 @@
+
+subdir('misc')
+subdir('domain')
+subdir('admin')
diff --git a/examples/c/misc/meson.build b/examples/c/misc/meson.build
new file mode 100644
index 0000000000..397258170f
--- /dev/null
+++ b/examples/c/misc/meson.build
@@ -0,0 +1,23 @@
+
+examples_misc_deps = [libvirt_dep]
+
+hellolibvirt_src = ['hellolibvirt.c']
+hellolibvirt = executable(
+ 'hellolibvirt',
+ hellolibvirt_src,
+ dependencies: examples_misc_deps
+)
+
+eventtest_src = ['event-test.c']
+eventtest = executable(
+ 'event-test',
+ eventtest_src,
+ dependencies: examples_misc_deps
+)
+
+openauth_src = ['openauth.c']
+openauth = executable(
+ 'openauth',
+ openauth_src,
+ dependencies: examples_misc_deps
+)
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000000..bb757e92a0
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,2 @@
+
+subdir('c')
diff --git a/meson.build b/meson.build
index 1febd9c35d..1b9efde467 100644
--- a/meson.build
+++ b/meson.build
@@ -33,3 +33,4 @@ gnulib_dep = declare_dependency(
meson.add_dist_script('build-aux' / 'dist.py', meson.source_root(),
meson.build_root())
subdir('src')
+subdir('examples')
--
2.21.0