All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl
@ 2022-04-17 14:50 Helge Konetzka
  2022-04-17 15:40 ` Konstantin Kostiuk
  2022-04-18  8:15 ` Marc-André Lureau
  0 siblings, 2 replies; 7+ messages in thread
From: Helge Konetzka @ 2022-04-17 14:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: Konstantin Kostiuk, Marc-André Lureau, Michael Roth

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-22 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-17 14:50 [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl Helge Konetzka
2022-04-17 15:40 ` Konstantin Kostiuk
2022-04-17 16:34   ` Helge Konetzka
2022-04-18  8:15 ` Marc-André Lureau
2022-04-20 11:17   ` Konstantin Kostiuk
2022-04-20 12:27     ` Marc-André Lureau
2022-04-22 17:12       ` Helge Konetzka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.