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() subdir_done()
endif 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'] libva_req = ['>= 1.6']
if host_system == 'windows' if host_system == 'windows'
libva_req = ['>= 1.18'] libva_req = ['>= 1.18']
endif endif
libva_dep = dependency('libva', version: libva_req, required: false, libva_dep = dependency('libva', version: libva_req, required: va_required,
fallback: ['libva', 'libva_dep']) fallback: ['libva', 'libva_dep'])
if not libva_dep.found() if not libva_dep.found()
subdir_done() subdir_done()
endif endif
if host_system == 'linux' 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']) fallback: ['libva', 'libva_drm_dep'])
if not libva_drm_dep.found() if not libva_drm_dep.found()
subdir_done() subdir_done()
endif endif
platform_deps += [libva_drm_dep] 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() if libdrm_dep.found()
platform_deps += [libdrm_dep] platform_deps += [libdrm_dep]
extra_args += ['-DHAVE_LIBDRM'] extra_args += ['-DHAVE_LIBDRM']
@ -78,13 +86,13 @@ if host_system == 'linux'
va_sources += va_linux_sources va_sources += va_linux_sources
va_headers += va_linux_headers va_headers += va_linux_headers
else 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']) fallback: ['libva', 'libva_win32_dep'])
if not libva_win32_dep.found() if not libva_win32_dep.found()
subdir_done() subdir_done()
endif endif
dxgi_lib = cc.find_library('dxgi', required : false) dxgi_lib = cc.find_library('dxgi', required: va_required)
if not dxgi_lib.found() if not dxgi_lib.found()
subdir_done() subdir_done()
endif endif

View file

@ -11,11 +11,9 @@ if host_system != 'linux'
endif endif
libdrm_dep = dependency('libdrm', version : '>= 2.4.98', libdrm_dep = dependency('libdrm', version : '>= 2.4.98',
required : get_option('kms'), required : get_option('kms'))
fallback: ['libdrm', 'ext_libdrm'])
libdrm_hdr_dep = dependency('libdrm', version : '>= 2.4.104', libdrm_hdr_dep = dependency('libdrm', version : '>= 2.4.104',
required : false, required : false)
fallback: ['libdrm', 'ext_libdrm'])
mathlib = cc.find_library('m', required : false) mathlib = cc.find_library('m', required : false)
if libdrm_hdr_dep.found() and mathlib.found() 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, libva_x11_dep = dependency('libva-x11', version: libva_req,
required: get_option('x11'), fallback : ['libva', 'libva_x11_dep']) required: get_option('x11'), fallback : ['libva', 'libva_x11_dep'])
libdrm_dep = dependency('libdrm', version: libdrm_req, libdrm_dep = dependency('libdrm', version: libdrm_req, required: get_option('drm'))
required: get_option('drm'), fallback: ['libdrm', 'ext_libdrm'])
libudev_dep = dependency('libudev', required: get_option('drm')) libudev_dep = dependency('libudev', required: get_option('drm'))
x11_dep = dependency('x11', required: get_option('x11')) x11_dep = dependency('x11', required: get_option('x11'))