OSDN Git Service

qga/vss-win32: use widl if available
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 1 Feb 2022 08:53:15 +0000 (12:53 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Feb 2022 09:35:53 +0000 (10:35 +0100)
widl from mingw64-tools and wine can compile a TLB file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qga/vss-win32/meson.build

index 78bdf5e..8f3aff5 100644 (file)
@@ -18,15 +18,18 @@ if add_languages('cpp', required: false)
   all_qga += qga_vss
 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)
+widl = find_program('widl', required: false)
 if midl.found()
   gen_tlb = custom_target('gen-tlb',
                           input: 'qga-vss.idl',
                           output: 'qga-vss.tlb',
                           command: [midl, '@INPUT@', '/tlb', '@OUTPUT@'])
+elif widl.found()
+  gen_tlb = custom_target('gen-tlb',
+                          input: 'qga-vss.idl',
+                          output: 'qga-vss.tlb',
+                          command: [widl, '-t', '@INPUT@', '-o', '@OUTPUT@'])
 else
   gen_tlb = custom_target('gen-tlb',
                           input: 'qga-vss.tlb',