Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/Makefile.am | 1 -
src/hyperv/Makefile.inc.am | 46 --------------------------------------
src/hyperv/meson.build | 41 +++++++++++++++++++++++++++++++++
src/meson.build | 1 +
4 files changed, 42 insertions(+), 47 deletions(-)
delete mode 100644 src/hyperv/Makefile.inc.am
create mode 100644 src/hyperv/meson.build
diff --git a/src/Makefile.am b/src/Makefile.am
index 24c4a7cb194..daab843febd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -78,7 +78,6 @@ include admin/Makefile.inc.am
include test/Makefile.inc.am
include hypervisor/Makefile.inc.am
include esx/Makefile.inc.am
-include hyperv/Makefile.inc.am
include vmx/Makefile.inc.am
include vmware/Makefile.inc.am
include vbox/Makefile.inc.am
diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am
deleted file mode 100644
index 6e15f0682d9..00000000000
--- a/src/hyperv/Makefile.inc.am
+++ /dev/null
@@ -1,46 +0,0 @@
-# vim: filetype=automake
-
-HYPERV_DRIVER_SOURCES = \
- hyperv/hyperv_private.h \
- hyperv/hyperv_driver.c \
- hyperv/hyperv_driver.h \
- hyperv/hyperv_util.c \
- hyperv/hyperv_util.h \
- hyperv/hyperv_wmi.c \
- hyperv/hyperv_wmi.h \
- hyperv/hyperv_wmi_classes.c \
- hyperv/hyperv_wmi_classes.h \
- hyperv/openwsman.h \
- $(NULL)
-
-HYPERV_DRIVER_GENERATED = \
- hyperv/hyperv_wmi_classes.generated.c \
- hyperv/hyperv_wmi_classes.generated.h \
- hyperv/hyperv_wmi_classes.generated.typedef \
- $(NULL)
-
-HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp
-
-DRIVER_SOURCE_FILES += $(addprefix $(srcdir)/,$(HYPERV_DRIVER_SOURCES))
-
-$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)
-
-$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
- $(top_srcdir)/scripts/hyperv_wmi_generator.py
- $(AM_V_GEN) $(RUNUTF8) $(PYTHON) \
- $(top_srcdir)/scripts/hyperv_wmi_generator.py $(srcdir) $(builddir) \
- && touch $@
-
-if WITH_HYPERV
-noinst_LTLIBRARIES += libvirt_driver_hyperv.la
-libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
-libvirt_driver_hyperv_la_CFLAGS = \
- $(OPENWSMAN_CFLAGS) \
- -I$(srcdir)/conf \
- -I$(builddir)/hyperv \
- $(AM_CFLAGS) \
- $(NULL)
-libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
-libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
-endif WITH_HYPERV
diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build
new file mode 100644
index 00000000000..71382e3db0e
--- /dev/null
+++ b/src/hyperv/meson.build
@@ -0,0 +1,41 @@
+hyperv_sources = [
+ 'hyperv_driver.c',
+ 'hyperv_util.c',
+ 'hyperv_wmi.c',
+ 'hyperv_wmi_classes.c',
+]
+
+hyperv_gen_sources = custom_target(
+ 'virthypervgen',
+ input: [
+ 'hyperv_wmi_generator.input',
+ ],
+ output: [
+ 'hyperv_wmi_classes.generated.c',
+ 'hyperv_wmi_classes.generated.h',
+ 'hyperv_wmi_classes.generated.typedef',
+ ],
+ command: [
+ meson_python_prog,
+ hyperv_wmi_generator_prog,
+ meson.source_root() / 'src',
+ meson.build_root() / 'src',
+ ],
+)
+
+if conf.has('WITH_HYPERV')
+ hyperv_lib = static_library(
+ 'virt_driver_hyperv',
+ [
+ hyperv_sources,
+ hyperv_gen_sources[1],
+ ],
+ dependencies: [
+ openwsman_dep,
+ src_dep,
+ ],
+ include_directories: [
+ conf_inc_dir,
+ ]
+ )
+endif
diff --git a/src/meson.build b/src/meson.build
index 794c717f136..3186f1c13e3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -88,4 +88,5 @@ subdir('vmx')
subdir('admin')
subdir('esx')
+subdir('hyperv')
subdir('vmware')
--
2.26.2