1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 03:55:04 +03:00

meson: fix compilation on BSDs with icu+iconv

on BSDs, icu is installed and included from /usr/local. When found,
libiconv headers override the normal ones and thus result in a missing
link. Work around this oddity and add the link.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-06-15 19:41:08 -07:00
parent 915951b87b
commit b4b4162fc7

View File

@ -561,9 +561,24 @@ else
endif
xml_deps += lzma_dep
# icu
icu_dep = dependency('icu-i18n', method: 'pkg-config', required: get_option('icu'))
if icu_dep.found()
defs = icu_dep.get_variable(pkgconfig: 'DEFS')
if cc.has_argument(defs)
libxml2_cflags += defs
endif
endif
xml_deps += icu_dep
### iconv
if not get_option('minimum')
iconv_dep = dependency('iconv', required: get_option('iconv'))
# this is a hack for the BSDs. The iconv dependency works as long as libiconv is not in the include path.
if sys_bsd and icu_dep.found()
iconv_dep = cc.find_library('iconv', dirs: icu_dep.get_variable(pkgconfig: 'includedir'), required: get_option('iconv'))
else
iconv_dep = dependency('iconv', required: get_option('iconv'))
endif
else
iconv_dep = dependency('', required: false)
endif
@ -575,16 +590,6 @@ else
want_iso8859x = true
endif
# icu
icu_dep = dependency('icu-i18n', method: 'pkg-config', required: get_option('icu'))
if icu_dep.found()
defs = icu_dep.get_variable(pkgconfig: 'DEFS')
if cc.has_argument(defs)
libxml2_cflags += defs
endif
endif
xml_deps += icu_dep
subdir('include/libxml')
# Set config_h after all subdirs and dependencies have set values