[libcamera-devel,2/3] meson: Add configuration option to build the cam application
diff mbox series

Message ID 20210320214531.10172-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Untitled series #1807
Related show

Commit Message

Laurent Pinchart March 20, 2021, 9:45 p.m. UTC
Building the cam application isn't always desired, for instance in a
production environment that only needs the libcamera library. Add a
meson option to disable it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 meson_options.txt   | 5 +++++
 src/cam/meson.build | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Kieran Bingham March 23, 2021, 3:20 p.m. UTC | #1
Hi Laurent,

On 20/03/2021 21:45, Laurent Pinchart wrote:
> Building the cam application isn't always desired, for instance in a
> production environment that only needs the libcamera library. Add a
> meson option to disable it.
> 

Great, this makes it much more explicit.

But now we need to make sure we include in the summary if we build cam
or not.

And given the title of 3/3, I suspect that won't be an issue....

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  meson_options.txt   | 5 +++++
>  src/cam/meson.build | 3 +--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index f6b6c65c5c85..12de8fa161f8 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -11,6 +11,11 @@ option('android_platform',
>          value : 'generic',
>          description : 'Select the Android platform to compile for')
>  
> +option('cam',
> +        type : 'feature',
> +        value : 'auto',
> +        description : 'Compile the cam test application')
> +
>  option('documentation',
>          type : 'feature',
>          description : 'Generate the project documentation')
> diff --git a/src/cam/meson.build b/src/cam/meson.build
> index f0c08589a654..65784beda4e6 100644
> --- a/src/cam/meson.build
> +++ b/src/cam/meson.build
> @@ -1,9 +1,8 @@
>  # SPDX-License-Identifier: CC0-1.0
>  
> -libevent = dependency('libevent_pthreads', required : false)
> +libevent = dependency('libevent_pthreads', required : get_option('cam'))
>  
>  if not libevent.found()
> -    warning('libevent_pthreads not found, \'cam\' application will not be compiled')
>      subdir_done()
>  endif
>  
>

Patch
diff mbox series

diff --git a/meson_options.txt b/meson_options.txt
index f6b6c65c5c85..12de8fa161f8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,6 +11,11 @@  option('android_platform',
         value : 'generic',
         description : 'Select the Android platform to compile for')
 
+option('cam',
+        type : 'feature',
+        value : 'auto',
+        description : 'Compile the cam test application')
+
 option('documentation',
         type : 'feature',
         description : 'Generate the project documentation')
diff --git a/src/cam/meson.build b/src/cam/meson.build
index f0c08589a654..65784beda4e6 100644
--- a/src/cam/meson.build
+++ b/src/cam/meson.build
@@ -1,9 +1,8 @@ 
 # SPDX-License-Identifier: CC0-1.0
 
-libevent = dependency('libevent_pthreads', required : false)
+libevent = dependency('libevent_pthreads', required : get_option('cam'))
 
 if not libevent.found()
-    warning('libevent_pthreads not found, \'cam\' application will not be compiled')
     subdir_done()
 endif