meson: Fix libdrm and vaapi configure checks

We do not need fallback: for libdrm checks because the wrap file
already has a [provide] section.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4428>
This commit is contained in:
Nirbheek Chauhan 2023-04-14 13:18:52 +05:30
parent beb21f9254
commit 55ee0635d3
3 changed files with 17 additions and 12 deletions

View file

@ -49,27 +49,35 @@ if host_system not in ['linux', 'windows']
subdir_done()
endif
va_opt = get_option('va')
msdk_opt = get_option('msdk')
qsv_opt = get_option('qsv')
if va_opt.disabled() and msdk_opt.disabled() and qsv_opt.disabled()
subdir_done()
endif
va_required = va_opt.enabled() or msdk_opt.enabled() or qsv_opt.enabled()
libva_req = ['>= 1.6']
if host_system == 'windows'
libva_req = ['>= 1.18']
endif
libva_dep = dependency('libva', version: libva_req, required: false,
libva_dep = dependency('libva', version: libva_req, required: va_required,
fallback: ['libva', 'libva_dep'])
if not libva_dep.found()
subdir_done()
endif
if host_system == 'linux'
libva_drm_dep = dependency('libva-drm', version: libva_req, required: false,
libva_drm_dep = dependency('libva-drm', version: libva_req, required: va_required,
fallback: ['libva', 'libva_drm_dep'])
if not libva_drm_dep.found()
subdir_done()
endif
platform_deps += [libva_drm_dep]
libdrm_dep = dependency('libdrm', required: false, fallback: ['libdrm', 'ext_libdrm'])
libdrm_dep = dependency('libdrm', version: '>=2.4', required: false)
if libdrm_dep.found()
platform_deps += [libdrm_dep]
extra_args += ['-DHAVE_LIBDRM']
@ -78,13 +86,13 @@ if host_system == 'linux'
va_sources += va_linux_sources
va_headers += va_linux_headers
else
libva_win32_dep = dependency('libva-win32', version: libva_req, required: false,
libva_win32_dep = dependency('libva-win32', version: libva_req, required: va_required,
fallback: ['libva', 'libva_win32_dep'])
if not libva_win32_dep.found()
subdir_done()
endif
dxgi_lib = cc.find_library('dxgi', required : false)
dxgi_lib = cc.find_library('dxgi', required: va_required)
if not dxgi_lib.found()
subdir_done()
endif

View file

@ -11,11 +11,9 @@ if host_system != 'linux'
endif
libdrm_dep = dependency('libdrm', version : '>= 2.4.98',
required : get_option('kms'),
fallback: ['libdrm', 'ext_libdrm'])
required : get_option('kms'))
libdrm_hdr_dep = dependency('libdrm', version : '>= 2.4.104',
required : false,
fallback: ['libdrm', 'ext_libdrm'])
required : false)
mathlib = cc.find_library('m', required : false)
if libdrm_hdr_dep.found() and mathlib.found()

View file

@ -88,8 +88,7 @@ libva_wayland_dep = dependency('libva-wayland', version: libva_req,
libva_x11_dep = dependency('libva-x11', version: libva_req,
required: get_option('x11'), fallback : ['libva', 'libva_x11_dep'])
libdrm_dep = dependency('libdrm', version: libdrm_req,
required: get_option('drm'), fallback: ['libdrm', 'ext_libdrm'])
libdrm_dep = dependency('libdrm', version: libdrm_req, required: get_option('drm'))
libudev_dep = dependency('libudev', required: get_option('drm'))
x11_dep = dependency('x11', required: get_option('x11'))