aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-07-15 11:39:13 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:12 -0400
commit7272fc72682c2573c67136e2c175d33d00d8905b (patch)
treea3922cfcbffade17e643b85f7e756a1b66741ca5 /qga
parentf15bff25f7c6843d698e122dc8d1b5927360f6c1 (diff)
meson: convert vss-win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qga')
-rw-r--r--qga/Makefile.objs1
-rw-r--r--qga/meson.build6
-rw-r--r--qga/vss-win32/Makefile.objs23
-rw-r--r--qga/vss-win32/meson.build33
4 files changed, 39 insertions, 24 deletions
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..9ddb260cff 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 targetos == '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