[libcamera-devel] [PATCH v4 1/3] meson: Move libevent dependency lookup

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Mar 30 00:42:13 CEST 2021


Hi Niklas,

Thank you for the patch.

On Mon, Mar 29, 2021 at 07:02:48PM +0200, Niklas Söderlund wrote:
> The libevent library will be needed by both cam and the soon to be added
> lc-compliacne tool. Move the dependency lookup to a shared meson file to

s/compliacne/compliance/ (libcamera doesn't address skin issues yet)

> avoid having to look it up twice.
> 
> Suggested-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
>  src/cam/meson.build | 2 --
>  src/meson.build     | 2 ++
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/cam/meson.build b/src/cam/meson.build
> index 5e1a7f387d60a98f..13e6201a08a214cf 100644
> --- a/src/cam/meson.build
> +++ b/src/cam/meson.build
> @@ -1,7 +1,5 @@
>  # SPDX-License-Identifier: CC0-1.0
>  
> -libevent = dependency('libevent_pthreads', required : get_option('cam'))
> -
>  if not libevent.found()

This is a bit of an annoying once, as if the 'cam' option is set to
enabled, it shouldn't be disabled silently. The cam option is new, so
the problem didn't occur before.

We could print an error message manually here if the 'cam' option is set
to enabled, but that's not great. I'm tempted to keep the code as-is and
duplicate the dependency() in the lc-compliance meson.build.

Sorry for the bad suggestion.

>      cam_enabled = false
>      subdir_done()
> diff --git a/src/meson.build b/src/meson.build
> index c908b0675773301d..14c49f6eeb1f5a01 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -11,6 +11,8 @@ else
>      ipa_sign_module = false
>  endif
>  
> +libevent = dependency('libevent_pthreads', required : false)
> +
>  libcamera_objects = []
>  
>  # The 'android' subdir must be processed first, and the build targets

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list