diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-07-07 00:20:41 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-10-12 13:08:48 +0530 |
commit | 00c29e1fbe231a6bcb0041fa14298e539963f258 (patch) | |
tree | 80e39d863cca25c0a6b25251b55bdc85899f8b4b /meson.build | |
parent | de3e5be2350e988053c0b76d5be7e6a1633b9713 (diff) | |
download | gtk+-00c29e1fbe231a6bcb0041fa14298e539963f258.tar.gz |
meson: Use proxy-libintl subproject when needed and available
Such as on Windows with MSVC.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 5e48265cd4..1483353cfa 100644 --- a/meson.build +++ b/meson.build @@ -591,9 +591,24 @@ endif # Check for bind_textdomain_codeset, including -lintl if GLib brings it in by # doing the same check as glib. We can't check that by linking to glib because # it might be a subproject and hence not built yet. -libintl_dep = cc.find_library('intl', required : false) -if cc.has_function('bind_textdomain_codeset', dependencies: libintl_dep) +if cc.has_function('ngettext') + libintl_dep = [] cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) +else + libintl_dep = cc.find_library('intl', required : false) + if cc.has_function('bind_textdomain_codeset', dependencies: libintl_dep) + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) + else + # Don't use subproject('proxy-libintl').get_variable('intl_dep') because that + # makes the dependency unconditional. This way, people have the option of + # either not providing the subproject or disabling it entirely with + # --wrap-mode=nodownload or nofallback. + libintl_dep = dependency('', required : false, + fallback: ['proxy-libintl', 'intl_dep']) + if libintl_dep.found() + cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1) + endif + endif endif if os_unix |