aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-11-25 21:08:19 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-11-28 18:30:01 +0200
commit1e19757899fe4388766d71244a2143016ca939ec (patch)
tree622b4dc704ce3365606b1241e10b2895ae8f5a3b /mesonbuild/dependencies
parentb361fc52dd52c7e587ee5a35dc845885c431d434 (diff)
downloadmeson-1e19757899fe4388766d71244a2143016ca939ec.zip
meson-1e19757899fe4388766d71244a2143016ca939ec.tar.gz
meson-1e19757899fe4388766d71244a2143016ca939ec.tar.bz2
iconv dependency: try even harder to find working iconv
has_function(prefix: '...') is useless to check the difference between builtins and external library functions. It has code to detect "builtins" that misfires and reports that iconv_open is defined as a builtin on mingw, but only if you include the header. Instead compile an open-coded test file that this iconv dependency implementation fully controls, that doesn't get up to imaginative edge cases like trying to find `__builtin_iconv_open`. Fixes commit db1fa702f3943c6e4fec142b2bf5468c89173993, which merely moved the brokenness over one step to the right (by breaking mingw instead of freebsd) Fixes https://github.com/mesonbuild/meson/pull/9632#issuecomment-979581509
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r--mesonbuild/dependencies/misc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 43d7feb..e490e7d 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -451,8 +451,9 @@ class CursesSystemDependency(SystemDependency):
class IconvBuiltinDependency(BuiltinDependency):
def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]):
super().__init__(name, env, kwargs)
+ code = '''#include <iconv.h>\n\nint main() {\n iconv_open("","");\n}''' # [ignore encoding] this is C, not python, Mr. Lint
- if self.clib_compiler.has_function('iconv_open', '#include <iconv.h>', env)[0]:
+ if self.clib_compiler.links(code, env)[0]:
self.is_found = True