[PATCH 3/7] qga/meson: Use windows.compile_resources instead of custom_target

Kostiantyn Kostiuk posted 7 patches 2 days, 15 hours ago
Maintainers: Kostiantyn Kostiuk <kkostiuk@redhat.com>, Michael Roth <michael.roth@amd.com>
[PATCH 3/7] qga/meson: Use windows.compile_resources instead of custom_target
Posted by Kostiantyn Kostiuk 2 days, 15 hours ago
windows.compile_resources supports more compiles and works
in both MinGW and MSVC environment. While 'windres' is a
MinGW specific tool.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
 qga/meson.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/qga/meson.build b/qga/meson.build
index 1c6433ef25..85bdacf7e2 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -105,16 +105,14 @@ endif
 qga_objs = []
 if host_os == 'windows'
   windmc = find_program('windmc', required: true)
-  windres = find_program('windres', required: true)
 
   msgrc = custom_target('messages-win32.rc',
                         input: 'messages-win32.mc',
                         output: ['messages-win32.rc', 'MSG00409.bin', 'messages-win32.h'],
                         command: [windmc, '-h', '@OUTDIR@', '-r', '@OUTDIR@', '@INPUT@'])
-  msgobj = custom_target('messages-win32.o',
-                         input: msgrc[0],
-                         output: 'messages-win32.o',
-                         command: [windres, '-I', '@OUTDIR@', '-o', '@OUTPUT@', '@INPUT@'])
+
+  windows = import('windows')
+  msgobj = windows.compile_resources(msgrc[0])
 
   qga_objs = [msgobj]
 endif
-- 
2.52.0