src: hyperv: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Pavel Hrdina 2019-10-16 14:46:20 +02:00
parent 11a865b9f9
commit 29b4dda5f5
3 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View File

@ -41,7 +41,6 @@ Makefile.in
# libvirt related ignores
/build/
/ci/scratch/
/src/hyperv/*.generated.*
/src/locking/lock_daemon_dispatch_stubs.h
/src/logging/log_daemon_dispatch_stubs.h
/src/lxc/lxc_controller_dispatch.h

View File

@ -41,8 +41,8 @@ $(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)
$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
$(srcdir)/hyperv/hyperv_wmi_generator.py
$(AM_V_GEN)srcdir=$(srcdir) $(RUNUTF8) $(PYTHON) \
$(srcdir)/hyperv/hyperv_wmi_generator.py \
$(AM_V_GEN) $(RUNUTF8) $(PYTHON) \
$(srcdir)/hyperv/hyperv_wmi_generator.py $(srcdir) $(builddir) \
&& touch $@
MAINTAINERCLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP)
@ -53,6 +53,7 @@ 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)

View File

@ -454,12 +454,11 @@ def parse_class(block):
def main():
if "srcdir" in os.environ:
input_filename = os.path.join(os.environ["srcdir"], "hyperv/hyperv_wmi_generator.input")
output_dirname = os.path.join(os.environ["srcdir"], "hyperv")
else:
input_filename = os.path.join(os.getcwd(), "hyperv_wmi_generator.input")
output_dirname = os.getcwd()
if len(sys.argv) != 3:
report_error("usage: %s srcdir builddir" % sys.argv[0])
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"))