[RFC PATCH v1] meson: Convert `v4l2` into a feature option
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sun Dec 15 20:52:27 CET 2024
Hi Barnabás,
Thank you for the patch.
On Sun, Dec 15, 2024 at 07:23:57PM +0000, Barnabás Pőcze wrote:
> 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.
The first use case doesn't seem very useful to me, as the v4l2 option is
set to false by default, so we can already start with the option
disabled and enable it only when desired.
The second use case is a bit more interesting.
You will however need to update CI, and it will break all packaging
scripts that set the option explicitly to false or true, so I wonder if
it's really worth it. If there's a general consensus that we should
change the option type, I'm OK with this patch.
> Signed-off-by: Barnabás Pőcze <pobrn at protonmail.com>
> ---
> meson_options.txt | 4 ++--
> src/v4l2/meson.build | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meson_options.txt b/meson_options.txt
> index c91cd241a..08e224561 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -84,6 +84,6 @@ option('udev',
> description : 'Enable udev support for hotplug')
>
> option('v4l2',
> - type : 'boolean',
> - value : false,
> + type : 'feature',
> + value : 'auto',
> description : 'Compile the V4L2 compatibility layer')
> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
> index 58f53bf3d..e4daf8ae7 100644
> --- a/src/v4l2/meson.build
> +++ b/src/v4l2/meson.build
> @@ -1,6 +1,6 @@
> # SPDX-License-Identifier: CC0-1.0
>
> -if not get_option('v4l2')
> +if not get_option('v4l2').allowed()
> v4l2_enabled = false
> subdir_done()
> endif
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list