build-sys: meson: when libc iconv is used, tell libiconv header to pretend to be...
authorGreg V <greg@unrelenting.technology>
Fri, 3 Apr 2020 15:51:59 +0000 (18:51 +0300)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Mon, 18 Jan 2021 16:33:52 +0000 (16:33 +0000)
The libiconv header on FreeBSD would be preferred by include path, but
we don't want to link to libiconv, so tell its header to act like
the system header.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/277>

meson.build

index 38d56ba..51ef844 100644 (file)
@@ -439,6 +439,8 @@ have_iconv = false
 if cc.has_function('iconv_open')
   iconv_dep = dependency('', required : false)
   have_iconv = true
+  # tell the libiconv header to pretend to be libc iconv
+  cdata.set('LIBICONV_PLUG', 1)
 else
   iconv_dep = cc.find_library('iconv', required : false)
   have_iconv = iconv_dep.found()