Meson: Try harder to look for ICU on Visual Studio

ICU's Visual Studio build files do not generate pkg-config files for us, unless
it is built with Cygwin instead of the project files.  If pkg-config files for
ICU cannot be found, look for its headers and .lib manually.
This commit is contained in:
Chun-wei Fan 2020-03-13 16:40:20 +08:00 committed by Ebrahim Byagowi
parent 7baa8e0dbe
commit 5efce600ab
1 changed files with 20 additions and 1 deletions

View File

@ -95,9 +95,28 @@ cairo_dep = dependency('cairo', required: get_option('cairo'),
fontconfig_dep = dependency('fontconfig', required: get_option('fontconfig'),
fallback: ['fontconfig', 'fontconfig_dep'])
graphite2_dep = dependency('graphite2', required: get_option('graphite'))
icu_dep = dependency('icu-uc', required: get_option('icu'))
icu_dep = dependency('icu-uc', required: get_option('icu').enabled() and cpp.get_id() != 'msvc')
m_dep = cpp.find_library('m', required: false)
if not icu_dep.found() and cpp.get_id() == 'msvc'
if cpp.has_header('unicode/uchar.h') and \
cpp.has_header('unicode/unorm2.h') and \
cpp.has_header('unicode/ustring.h') and \
cpp.has_header('unicode/utf16.h') and \
cpp.has_header('unicode/uversion.h') and \
cpp.has_header('unicode/uscript.h')
if get_option('buildtype') == 'debug'
icu_dep = cpp.find_library('icuucd', required: get_option('icu'))
else
icu_dep = cpp.find_library('icuuc', required: get_option('icu'))
endif
else
if get_option('icu').enabled()
error('ICU headers and libraries must be present to build ICU support')
endif
endif
endif
# Ensure that cairo-ft is fetched from the same library as cairo itself
if cairo_dep.found()
if cairo_dep.type_name() == 'pkgconfig'