qga/meson: Use windows.compile_resources instead of custom_target

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>
Link: https://lore.kernel.org/r/20260330113906.168002-4-kkostiuk@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Kostiantyn Kostiuk
2026-03-30 14:39:02 +03:00
committed by Paolo Bonzini
parent a2f3d1405a
commit dbf0fcef7e

View File

@@ -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