From fcf68f8f317fbc8af531fc0ffa9d7d7c22b7e21e Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 11 Apr 2019 18:00:05 +0530 Subject: [PATCH] meson: Hotfix for iconv detection on macOS macOS/iOS do not ship iconv inside the C library, so don't try to look for that at all when targetting macOS or iOS. The proper fix involved changing the options and will be merged in master: https://gitlab.gnome.org/GNOME/glib/merge_requests/759 --- meson.build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index af0103c13..682a0e8fd 100644 --- a/meson.build +++ b/meson.build @@ -1680,13 +1680,20 @@ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack) # We should never use the MinGW C library's iconv. On Windows we use the # GNU implementation that ships with MinGW. +iconv_opt = get_option('iconv') + +# On Darwin, the libc doesn't provide iconv. Instead, the OS provides libiconv +# as a separate (non-GNU) library. Set the option to 'native'. +if host_system == 'darwin' and iconv_opt == 'libc' + iconv_opt = 'native' +endif + # On Windows, just always use the built-in implementation if host_system == 'windows' libiconv = [] glib_conf.set('USE_LIBICONV_NATIVE', true) else found_iconv = false - iconv_opt = get_option('iconv') if iconv_opt == 'libc' if cc.has_function('iconv_open') libiconv = []