1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-25 10:50:08 +03:00

build: Check for icu-uc instead of icu-i18n

This should be the ICU component we actually need.
This commit is contained in:
Nick Wellnhofer 2024-11-13 19:08:47 +01:00
parent aaecdc92e2
commit b57e022d75
3 changed files with 9 additions and 13 deletions

View File

@ -118,7 +118,7 @@ if(LIBXML2_WITH_ICONV)
endif()
if(LIBXML2_WITH_ICU)
find_package(ICU REQUIRED COMPONENTS data i18n uc)
find_package(ICU REQUIRED COMPONENTS uc)
endif()
if(LIBXML2_WITH_LZMA)
@ -336,16 +336,12 @@ if(LIBXML2_WITH_ICONV)
endif()
if(LIBXML2_WITH_ICU)
target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
if(WIN32)
set(ICU_LDFLAGS "-licudt -licuin -licuuc")
else()
set(ICU_LDFLAGS "-licudata -licui18n -licuuc")
endif()
target_link_libraries(LibXml2 PRIVATE ICU::uc)
set(ICU_LDFLAGS "-licuuc")
list(APPEND XML_PRIVATE_LIBS "${ICU_LDFLAGS}")
pkg_check_modules(ICU_PC IMPORTED_TARGET icu-i18n)
pkg_check_modules(ICU_PC IMPORTED_TARGET icu-uc)
if(ICU_PC_FOUND)
list(APPEND XML_PC_REQUIRES icu-i18n)
list(APPEND XML_PC_REQUIRES icu-uc)
else()
list(APPEND XML_PC_LIBS "${ICU_LDFLAGS}")
endif()

View File

@ -984,10 +984,10 @@ if test "$with_icu" != "no" && test "$with_icu" != "" ; then
# Try pkg-config first so that static linking works.
# If this succeeeds, we ignore the WITH_ICU directory.
PKG_CHECK_MODULES([ICU], [icu-i18n], [
WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-i18n"
PKG_CHECK_MODULES([ICU], [icu-uc], [
WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-uc"
m4_ifdef([PKG_CHECK_VAR],
[PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])])
[PKG_CHECK_VAR([ICU_DEFS], [icu-uc], [DEFS])])
if test "x$ICU_DEFS" != "x"; then
ICU_CFLAGS="$ICU_CFLAGS $ICU_DEFS"
fi],[:])

View File

@ -374,7 +374,7 @@ endif
# icu
if want_icu
icu_dep = dependency('icu-i18n', method: 'pkg-config')
icu_dep = dependency('icu-uc')
defs = icu_dep.get_variable(pkgconfig: 'DEFS')
if cc.has_argument(defs)
libxml2_cflags += defs