diff options
author | Andrew Krasavin <noiseless-ak@yandex.ru> | 2022-01-29 11:48:06 +0300 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-02-02 02:34:49 +0000 |
commit | 8172c501ac074af8ec02d32d7e1864700e8ec69a (patch) | |
tree | 4756f37fa4484b5df19de559b070cc856856e560 | |
parent | 712ef65e2a830e9db082d5d36563ff0d1df0097c (diff) | |
download | mpv-8172c501ac074af8ec02d32d7e1864700e8ec69a.tar.bz2 mpv-8172c501ac074af8ec02d32d7e1864700e8ec69a.tar.xz |
meson: fix libdl existence check for *bsd systems
-rw-r--r-- | meson.build | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/meson.build b/meson.build index ce28e18dea..468a048eab 100644 --- a/meson.build +++ b/meson.build @@ -336,14 +336,15 @@ if get_option('ta-leak-report') features += 'ta-leak-report' endif -libdl = cc.find_library('libdl', required: false) -if libdl.found() - dependencies += libdl +libdl_dep = cc.find_library('libdl', required: false) +libdl = cc.has_function('dlopen', dependencies: libdl_dep, prefix: '#include <dlfcn.h>') +if libdl + dependencies += libdl_dep features += 'libdl' endif cplugins = get_option('cplugins').require( - libdl.found() and not win32 and cc.has_link_argument('-rdynamic'), + libdl and not win32 and cc.has_link_argument('-rdynamic'), error_message: 'cplugins not supported by the os or compiler!', ) if cplugins.allowed() @@ -1425,7 +1426,7 @@ vaapi = { 'name': 'vaapi', 'deps': dependency('libva', version: '>= 1.1.0', required: get_option('vaapi')), } -vaapi += {'use': vaapi['deps'].found() and libdl.found() and +vaapi += {'use': vaapi['deps'].found() and libdl and (x11['use'] or wayland['use'] or egl_drm.allowed())} if vaapi['use'] dependencies += vaapi['deps'] @@ -1751,7 +1752,7 @@ conf_data.set10('HAVE_JPEG', jpeg.found()) conf_data.set10('HAVE_LCMS2', lcms2.found()) conf_data.set10('HAVE_LIBARCHIVE', libarchive.found()) conf_data.set10('HAVE_LIBAVDEVICE', libavdevice.found()) -conf_data.set10('HAVE_LIBDL', libdl.found()) +conf_data.set10('HAVE_LIBDL', libdl) conf_data.set10('HAVE_LIBBLURAY', libbluray.found()) conf_data.set10('HAVE_LIBPLACEBO_V4', libplacebo_v4) conf_data.set10('HAVE_LINUX_FSTATFS', linux_fstatfs) |