meson: cleanup win32 library detection

As pointed out by Akihiko Odaki, all Win32 libraries in MinGW have lowercase
names.  This means that on (case-insensitive) Windows you can use the mixed-case
names suggested by Microsoft or all-lowercase names, while on Linux you need to
make them lowercase.

QEMU was already using lowercase names, so there is no need to test the
mixed-case name version of libSynchronization.  Remove the unnecessary test
and while at it make all the tests use "required: true".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2025-06-09 12:58:54 +02:00
parent a6f0227759
commit 9a02932b05

View file

@ -843,15 +843,12 @@ host_dsosuf = '.so'
if host_os == 'windows'
midl = find_program('midl', required: false)
widl = find_program('widl', required: false)
pathcch = cc.find_library('pathcch')
synchronization = cc.find_library('Synchronization', required: false)
if not synchronization.found()
# The library name is lowercase on mingw
synchronization = cc.find_library('synchronization', required: true)
endif
socket = cc.find_library('ws2_32')
winmm = cc.find_library('winmm')
# MinGW uses lowercase for library names
pathcch = cc.find_library('pathcch', required: true)
synchronization = cc.find_library('synchronization', required: true)
socket = cc.find_library('ws2_32', required: true)
winmm = cc.find_library('winmm', required: true)
win = import('windows')
version_res = win.compile_resources('version.rc',