[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 040/150] meson: convert vss-win32
From: |
Paolo Bonzini |
Subject: |
[PATCH 040/150] meson: convert vss-win32 |
Date: |
Mon, 17 Aug 2020 16:35:33 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 1 -
Makefile.objs | 8 --------
qga/Makefile.objs | 1 -
qga/meson.build | 6 ++++++
qga/vss-win32/Makefile.objs | 23 -----------------------
qga/vss-win32/meson.build | 33 +++++++++++++++++++++++++++++++++
6 files changed, 39 insertions(+), 33 deletions(-)
delete mode 100644 qga/Makefile.objs
delete mode 100644 qga/vss-win32/Makefile.objs
create mode 100644 qga/vss-win32/meson.build
diff --git a/Makefile b/Makefile
index 174d1ecc4f..9b35c0d00a 100644
--- a/Makefile
+++ b/Makefile
@@ -290,7 +290,6 @@ endif
dummy := $(call unnest-vars,, \
authz-obj-y \
chardev-obj-y \
- qga-vss-dll-obj-y \
block-obj-y \
block-obj-m \
storage-daemon-obj-y \
diff --git a/Makefile.objs b/Makefile.objs
index 259f9936ac..baf15656e8 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -91,11 +91,3 @@ common-obj-y += disas/
######################################################################
# Resource file for Windows executables
version-obj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.o
-
-######################################################################
-# guest agent
-
-# FIXME: a few definitions from qapi/qapi-types.o and
-# qapi/qapi-visit.o are needed by libqemuutil.a. These should be
-# extracted into a QAPI schema module, or perhaps a separate schema.
-qga-vss-dll-obj-y = qga/
diff --git a/qga/Makefile.objs b/qga/Makefile.objs
deleted file mode 100644
index 9ecf2496da..0000000000
--- a/qga/Makefile.objs
+++ /dev/null
@@ -1 +0,0 @@
-qga-vss-dll-obj-$(CONFIG_QGA_VSS) += vss-win32/
diff --git a/qga/meson.build b/qga/meson.build
index 3513a90f5d..948302e06d 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -44,3 +44,9 @@ qga = executable('qemu-ga', qga_ss.sources(),
link_args: config_host['LIBS_QGA'].split(),
dependencies: [qemuutil, libudev],
install: true)
+
+if host_machine.system() == 'windows'
+ if 'CONFIG_QGA_VSS' in config_host
+ subdir('vss-win32')
+ endif
+endif
diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
deleted file mode 100644
index c82676aeb8..0000000000
--- a/qga/vss-win32/Makefile.objs
+++ /dev/null
@@ -1,23 +0,0 @@
-# rules to build qga-vss.dll
-
-qga-vss-dll-obj-y += requester.o provider.o install.o
-
-obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
-$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS := $(filter-out -fstack-protector-all
-fstack-protector-strong, $(QEMU_CXXFLAGS)) -Wno-unknown-pragmas
-Wno-delete-non-virtual-dtor
-
-QGA_VSS_LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup
-lglib-2.0 -lole32 -loleaut32 -lshlwapi -luuid -lintl -lws2_32 -static
-$(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
- $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y)
$(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS)
$(QGA_VSS_LDFLAGS),"LINK","$(TARGET_DIR)$@")
-
-
-# rules to build qga-provider.tlb
-# Currently, only native build is supported because building .tlb
-# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
-MIDL=$(WIN_SDK)/Bin/midl
-
-$(obj)/qga-vss.tlb: $(SRC_PATH)/$(obj)/qga-vss.idl
-ifeq ($(WIN_SDK),"")
- $(call quiet-command,cp $(dir $<)qga-vss.tlb
$@,"COPY","$(TARGET_DIR)$@")
-else
- $(call quiet-command,$(MIDL) -tlb $@ -I $(WIN_SDK)/Include
$<,"MIDL","$(TARGET_DIR)$@")
-endif
diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build
new file mode 100644
index 0000000000..42c8d31a3d
--- /dev/null
+++ b/qga/vss-win32/meson.build
@@ -0,0 +1,33 @@
+if add_languages('cpp', required: false)
+ glib_static = dependency('glib-2.0', static: true)
+ link_args = cc.get_supported_link_arguments(['-fstack-protector-all',
'-fstack-protector-strong',
+ '-Wl,--add-stdcall-alias',
'-Wl,--enable-stdcall-fixup'])
+ shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'],
+ name_prefix: '',
+ cpp_args: ['-Wno-unknown-pragmas',
'-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
+ link_args: link_args,
+ vs_module_defs: 'qga-vss.def',
+ dependencies: [glib_static, socket,
+ cc.find_library('ole32'),
+ cc.find_library('oleaut32'),
+ cc.find_library('shlwapi'),
+ cc.find_library('uuid'),
+ cc.find_library('intl')])
+endif
+
+# rules to build qga-vss.tlb
+# Currently, only native build is supported because building .tlb
+# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
+midl = find_program('midl', required: false)
+if midl.found()
+ gen_tlb = custom_target('gen-tlb',
+ input: 'qga-vss.idl',
+ output: 'qga-vss.tlb',
+ command: [midl, '-tlb', '-I' +
config_host['WIN_SDK'],
+ '@INPUT@', '@OUTPUT@'])
+else
+ gen_tlb = custom_target('gen-tlb',
+ input: 'qga-vss.tlb',
+ output: 'qga-vss.tlb',
+ command: ['cp', '@INPUT@', '@OUTPUT@'])
+endif
--
2.26.2
- [PATCH 026/150] meson: add version.o, (continued)
- [PATCH 026/150] meson: add version.o, Paolo Bonzini, 2020/08/17
- [PATCH 029/150] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 030/150] vhost-user-scsi: add compatibility for libiscsi 1.9.0, Paolo Bonzini, 2020/08/17
- [PATCH 032/150] contrib/rdmacm-mux: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 031/150] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 036/150] contrib/elf2dmp: convert to meson, Paolo Bonzini, 2020/08/17
- [PATCH 033/150] contrib/vhost-user-input: convert to meson, Paolo Bonzini, 2020/08/17
- [PATCH 034/150] contrib/vhost-user-gpu: convert to meson, Paolo Bonzini, 2020/08/17
- [PATCH 035/150] contrib/ivshmem: convert to meson, Paolo Bonzini, 2020/08/17
- [PATCH 041/150] meson: add msi generation, Paolo Bonzini, 2020/08/17
- [PATCH 040/150] meson: convert vss-win32,
Paolo Bonzini <=
- [PATCH 042/150] meson: convert dummy Windows qga/qemu-ga target, Paolo Bonzini, 2020/08/17
- [PATCH 043/150] meson: add qemu-bridge-helper, Paolo Bonzini, 2020/08/17
- [PATCH 047/150] meson: keymap-gen, Paolo Bonzini, 2020/08/17
- [PATCH 044/150] meson: add qemu-keymap, Paolo Bonzini, 2020/08/17
- [PATCH 038/150] meson: add solaris and Haiku libraries, Paolo Bonzini, 2020/08/17
- [PATCH 037/150] meson: add macos dependencies, Paolo Bonzini, 2020/08/17
- [PATCH 039/150] meson: convert qemu-ga, Paolo Bonzini, 2020/08/17
- [PATCH 045/150] meson: add qemu-edid, Paolo Bonzini, 2020/08/17
- [PATCH 046/150] meson: add virtfs-proxy-helper, Paolo Bonzini, 2020/08/17
- [PATCH 052/150] meson: convert check-decodetree, Paolo Bonzini, 2020/08/17