qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl


From: Helge Konetzka
Subject: [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl
Date: Sun, 17 Apr 2022 16:50:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

Generation with widl needs to be triggered explicitly and requires
library and include directories containing referenced *.idl and *.tlb
as parameters.

Signed-off-by: Helge Konetzka <hk@zapateado.de>
---

For tested Msys2 build all referenced resources reside in /<usr>/include.
Msys2 provides its flavours in different /<usr> bases.

This patch derives the missing include directory path from widl path.
Assuming the given widl path is /<usr>/bin/widl, it determines /<usr>
as base and appends /<usr>/include as include and library directories
to widl command. This way the directory is correct for any Msys2
flavour.
It makes sure, only existing directories are appended as parameter.

---
 qga/vss-win32/meson.build | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build
index 71c50d0866..51539a582c 100644
--- a/qga/vss-win32/meson.build
+++ b/qga/vss-win32/meson.build
@@ -30,9 +30,16 @@ if midl.found()
                           input: 'qga-vss.idl',
                           output: 'qga-vss.tlb',
                           command: [midl, '@INPUT@', '/tlb', '@OUTPUT@'])
-else
+elif widl.found()
+  widl_cmd = [widl, '-t', '@INPUT@', '-o', '@OUTPUT@']
+  usr_include = fs.parent(fs.parent(widl.full_path()))/'include'
+  if fs.is_dir(usr_include)
+    widl_cmd += ['-L', usr_include]
+    widl_cmd += ['-I', usr_include]
+  endif
   gen_tlb = custom_target('gen-tlb',
                           input: 'qga-vss.idl',
                           output: 'qga-vss.tlb',
- command: [widl, '-t', '@INPUT@', '-o', '@OUTPUT@'])
+                          build_by_default: true,
+                          command: widl_cmd)
 endif
--
2.30.2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]