meson: Convert v4l2 into a feature option

The v4l2 compatibility layer does not have external dependencies,
the usual benefits of a feature option do not apply. The main
motivation behind this change is making use of the `auto_features`
meson option that can change all feature options set to "auto"
by default to the desired value.

This can be useful for two reasons: (1) using auto_features=disabled
and then building up the list of features that are desired in the
particular build; (2) using auto_features=enabled to achieve
(usually) more testing and compilation coverage.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze 2024-12-16 17:52:15 +00:00
parent ac611e80d2
commit a945532314
2 changed files with 7 additions and 7 deletions

View file

@ -84,6 +84,7 @@ option('udev',
description : 'Enable udev support for hotplug') description : 'Enable udev support for hotplug')
option('v4l2', option('v4l2',
type : 'boolean', type : 'feature',
value : false, value : 'auto',
description : 'Compile the V4L2 compatibility layer') description : 'Compile the V4L2 compatibility layer',
deprecated : {'true': 'enabled', 'false': 'disabled'})

View file

@ -1,12 +1,11 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
if not get_option('v4l2') v4l2_enabled = get_option('v4l2').allowed()
v4l2_enabled = false
if not v4l2_enabled
subdir_done() subdir_done()
endif endif
v4l2_enabled = true
v4l2_compat_sources = files([ v4l2_compat_sources = files([
'v4l2_camera.cpp', 'v4l2_camera.cpp',
'v4l2_camera_file.cpp', 'v4l2_camera_file.cpp',