diff --git a/meson.build b/meson.build index 433ca01ee..4e44e265a 100644 --- a/meson.build +++ b/meson.build @@ -78,10 +78,14 @@ cc = meson.get_compiler('c') deps += cc.find_library('m', required: false) deps += cc.find_library('dl', required: false) -iconv_dep = cc.find_library('iconv', required: false) -if not (iconv_dep.found() or cc.has_function('iconv_open')) - iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port - iconv_dep = iconv_sp.get_variable('libiconv_dep') +if meson.version().version_compare('>=0.60.0') + iconv_dep = dependency('iconv', fallback: ['iconv', 'libiconv_dep']) +else + iconv_dep = cc.find_library('iconv', required: false) + if not (iconv_dep.found() or cc.has_function('iconv_open')) + iconv_sp = subproject('iconv') # this really needs to be replaced with a proper port + iconv_dep = iconv_sp.get_variable('libiconv_dep') + endif endif deps += iconv_dep