meson: src: build libvirt_driver_hyperv.a static library

Drop automake like print from scripts/hyperv_wmi_generator.py as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-27 08:24:55 +02:00
parent 1824c9968f
commit aa425c3308
5 changed files with 45 additions and 58 deletions

View File

@ -372,12 +372,7 @@ class Property:
return ' { "%s", "%s", %s },\n' % (self.name, self.type.lower(), str(self.is_array).lower())
def open_and_print(filename):
if filename.startswith("./"):
print(" GEN " + filename[2:])
else:
print(" GEN " + filename)
def open_file(filename):
return open(filename, "wt")
@ -438,9 +433,9 @@ def main():
input_filename = os.path.join(sys.argv[1], "hyperv", "hyperv_wmi_generator.input")
output_dirname = os.path.join(sys.argv[2], "hyperv")
classes_typedef = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.typedef"))
classes_header = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.h"))
classes_source = open_and_print(os.path.join(output_dirname, "hyperv_wmi_classes.generated.c"))
classes_typedef = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.typedef"))
classes_header = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.h"))
classes_source = open_file(os.path.join(output_dirname, "hyperv_wmi_classes.generated.c"))
# parse input file
number = 0

View File

@ -79,7 +79,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

View File

@ -1,48 +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))
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)
$(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

40
src/hyperv/meson.build Normal file
View File

@ -0,0 +1,40 @@
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, python3_prog.path(), hyperv_wmi_generator_prog.path(),
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

View File

@ -97,4 +97,5 @@ subdir('vmx')
subdir('admin')
subdir('esx')
subdir('hyperv')
subdir('vmware')