From 44ecf83a1bd94f69cbe7e55b900f2502d15d7d5c Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 18 Jun 2022 20:51:31 -0500 Subject: meson: use require when checking for vdpau Technically this was wrong. If you passed -Dvdpau=enabled but did not have x11 (a requirement for this), the build would silently just not build the vdpau VO. The correct behavior is for it to be a hard error. Accomplish this by using the require function and making sure that x11 is indeed being used before attempting to find the library. --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index a33ff141cb..5524828f88 100644 --- a/meson.build +++ b/meson.build @@ -1494,8 +1494,12 @@ if vaapi_egl['use'] or vaapi_libplacebo['use'] sources += files('video/out/hwdec/hwdec_vaapi.c') endif -vdpau = dependency('vdpau', version: '>= 0.2', required: get_option('vdpau')) -if vdpau.found() and x11['use'] +vdpau_opt = get_option('vdpau').require( + x11['use'], + error_message: 'x11 was not found!', +) +vdpau = dependency('vdpau', version: '>= 0.2', required: vdpau_opt) +if vdpau.found() dependencies += vdpau features += 'vdpau' sources += files('video/filter/vf_vdpaupp.c', -- cgit v1.2.3