meson: Clean up ICU dependency search
Since we are using Meson 0.60.0 or later, use CMake to help us find ICU, which is cleaner and more comprehensive, and allows us to use libicu_dep = depedency(...) even on Visual Studio, where CMake will find the appropriate ICU headers and libraries for us internally. Sadly, due to peculiarities, we have to live with the warning that comes up as we needed to look for ICU in the older method instead of the recommended modules: ['ICU::uc'] method.
This commit is contained in:
parent
927b202c69
commit
86923341a3
14
meson.build
14
meson.build
|
@ -40,17 +40,9 @@ if ['libidn2', 'auto'].contains(enable_runtime)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ['libicu', 'auto'].contains(enable_runtime)
|
if ['libicu', 'auto'].contains(enable_runtime)
|
||||||
libicu_dep = dependency('icu-uc', required : false)
|
libicu_dep = dependency('icu-uc', 'ICU',
|
||||||
if not libicu_dep.found() and cc.has_header('unicode/ustring.h')
|
components: 'uc',
|
||||||
# MSVC: the debug configuration of ICU generated the libraries with d suffix
|
required : false)
|
||||||
# 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 libicu_dep.found()
|
||||||
if enable_runtime == 'auto'
|
if enable_runtime == 'auto'
|
||||||
enable_runtime = 'libicu'
|
enable_runtime = 'libicu'
|
||||||
|
|
Loading…
Reference in New Issue