build-sys: meson: when libc iconv is used, tell libiconv header to pretend to be libc's iconv

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>
This commit is contained in:
Greg V 2020-04-03 18:51:59 +03:00 committed by PulseAudio Marge Bot
parent 42a9254891
commit 4ff664a3eb

View file

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