Merge branch 'libintl_fallback' into 'main'

meson: Allow forcing fallback for libintl

Closes #3048

See merge request GNOME/glib!3497
This commit is contained in:
Philip Withnall 2023-07-21 16:44:56 +00:00
commit 3ab16a0d18

View File

@ -2112,8 +2112,8 @@ libz_dep = dependency('zlib')
# implementations. This could be extended if issues are found in some platforms.
libintl_deps = []
libintl_prefix = '#include <libintl.h>'
libintl = dependency('intl', required: false, allow_fallback: false)
if libintl.found()
libintl = dependency('intl', required: false)
if libintl.found() and libintl.type_name() != 'internal'
# libintl supports different threading APIs, which may not
# require additional flags, but it defaults to using pthreads if
# found. Meson's "threads" dependency does not allow you to
@ -2140,9 +2140,10 @@ if libintl.found()
endif
endif
if libintl.found()
if libintl.found() and libintl.type_name() != 'internal'
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps, prefix: libintl_prefix)
else
# using proxy-libintl fallback
libintl = dependency('intl', allow_fallback: true)
assert(libintl.type_name() == 'internal')
libintl_deps = [libintl]