Merge pull request #125 from nacho/fix-msvc-icu-debug

meson: on msvc icu installs the libraries with a "d" suffix
This commit is contained in:
Tim Rühsen 2019-01-21 13:18:04 +01:00 committed by GitHub
commit b32e81367c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,10 @@ cc = meson.get_compiler('c')
enable_runtime = get_option('runtime')
enable_builtin = get_option('builtin')
# We need to know the build type to determine what .lib files we need on Visual Studio
# for dependencies that don't normally come with pkg-config files for Visual Studio builds
buildtype = get_option('buildtype')
notfound = dependency('', required : false)
libidn2_dep = notfound
libicu_dep = notfound
@ -38,7 +42,14 @@ endif
if ['libicu', 'auto'].contains(enable_runtime) or ['libicu', 'auto'].contains(enable_builtin)
libicu_dep = dependency('icu-uc', required : false)
if not libicu_dep.found() and cc.has_header('unicode/ustring.h')
libicu_dep = cc.find_library('icuuc', required : false)
# MSVC: the debug configuration of ICU generated the libraries with d suffix
# we must handle this and search for the right library depending on the
# build type. Note debugoptimized is just a release build with .pdb files enabled
if cc.get_id() == 'msvc' and buildtype == 'debug'
libicu_dep = cc.find_library('icuucd', required : false)
else
libicu_dep = cc.find_library('icuuc', required : false)
endif
endif
if libicu_dep.found()
if enable_runtime == 'auto'