meson: Add feature options for optional va deps libdrm and gudev

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4428>
This commit is contained in:
Nirbheek Chauhan 2023-04-14 16:11:55 +05:30
parent 55ee0635d3
commit 479f0175b5
3 changed files with 16 additions and 8 deletions

View file

@ -50,14 +50,20 @@ if host_system not in ['linux', 'windows']
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()
if host_system == 'linux'
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()
else
if va_opt.disabled()
subdir_done()
endif
va_required = va_opt
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']
@ -77,7 +83,7 @@ if host_system == 'linux'
endif
platform_deps += [libva_drm_dep]
libdrm_dep = dependency('libdrm', version: '>=2.4', required: false)
libdrm_dep = dependency('libdrm', version: '>=2.4', required: get_option('drm'))
if libdrm_dep.found()
platform_deps += [libdrm_dep]
extra_args += ['-DHAVE_LIBDRM']

View file

@ -74,6 +74,8 @@ option('y4m', type : 'feature', value : 'auto')
option('opencv', type : 'feature', value : 'auto', description : 'OpenCV computer vision library support')
# Feature options for optional deps in plugins
option('drm', type : 'feature', value : 'auto', description: 'libdrm support in the GstVA library')
option('udev', type : 'feature', value : 'auto', description: 'gudev support in the new VA-API plugin')
option('wayland', type : 'feature', value : 'auto', description : 'Wayland plugin/library, support in the Vulkan plugin')
option('x11', type : 'feature', value : 'auto', description : 'X11 support in Vulkan, GL and rfb plugins')

View file

@ -54,7 +54,7 @@ extra_dep = []
c_std_arg = ['c_std=c99']
if host_system == 'linux'
libgudev_dep = dependency('gudev-1.0', required: false, allow_fallback: true)
libgudev_dep = dependency('gudev-1.0', required: get_option('udev'), allow_fallback: true)
if libgudev_dep.found()
extra_args += ['-DHAVE_GUDEV']
extra_dep += [libgudev_dep]