[libcamera-devel,v2] meson: options: Add an option to control compilation of qcam

Message ID 20200619004443.3253953-1-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • [libcamera-devel,v2] meson: options: Add an option to control compilation of qcam
Related show

Commit Message

Niklas Söderlund June 19, 2020, 12:44 a.m. UTC
Add an option to control compilation of the qcam test application. The
default behavior is to compile qcam, no change in behavior without user
intervention.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
* Changes since v1
- Sort options alphabetical in meson_options.txt
- Use feature instead of boolean and attach it to the qt5_dep
---
 meson_options.txt    | 5 +++++
 src/qcam/meson.build | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart June 19, 2020, 10:19 a.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Fri, Jun 19, 2020 at 02:44:43AM +0200, Niklas Söderlund wrote:
> Add an option to control compilation of the qcam test application. The
> default behavior is to compile qcam, no change in behavior without user
> intervention.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
> * Changes since v1
> - Sort options alphabetical in meson_options.txt
> - Use feature instead of boolean and attach it to the qt5_dep
> ---
>  meson_options.txt    | 5 +++++
>  src/qcam/meson.build | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index badace151bb62bc9..44c40c1d96f8ec69 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -19,6 +19,11 @@ option('pipelines',
>          choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc'],
>          description : 'Select which pipeline handlers to include')
>  
> +option('qcam',
> +        type : 'feature',
> +        value : 'enabled',

Shouldn't this be 'auto' ? According to the meson documentation,

- enabled is the same as passing required : true.
- auto is the same as passing required : false.
- disabled do not look for the dependency and always return 'not-found'.

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +        description : 'Compile the qcam test application')
> +
>  option('test',
>          type : 'boolean',
>          description: 'Compile and include the tests')
> diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> index 045db52acf26d71b..6ea886a32236d40f 100644
> --- a/src/qcam/meson.build
> +++ b/src/qcam/meson.build
> @@ -22,7 +22,7 @@ qt5 = import('qt5')
>  qt5_dep = dependency('qt5',
>                       method : 'pkg-config',
>                       modules : ['Core', 'Gui', 'Widgets'],
> -                     required : false)
> +                     required : get_option('qcam'))
>  
>  if qt5_dep.found()
>      qcam_deps = [

Patch

diff --git a/meson_options.txt b/meson_options.txt
index badace151bb62bc9..44c40c1d96f8ec69 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,6 +19,11 @@  option('pipelines',
         choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc'],
         description : 'Select which pipeline handlers to include')
 
+option('qcam',
+        type : 'feature',
+        value : 'enabled',
+        description : 'Compile the qcam test application')
+
 option('test',
         type : 'boolean',
         description: 'Compile and include the tests')
diff --git a/src/qcam/meson.build b/src/qcam/meson.build
index 045db52acf26d71b..6ea886a32236d40f 100644
--- a/src/qcam/meson.build
+++ b/src/qcam/meson.build
@@ -22,7 +22,7 @@  qt5 = import('qt5')
 qt5_dep = dependency('qt5',
                      method : 'pkg-config',
                      modules : ['Core', 'Gui', 'Widgets'],
-                     required : false)
+                     required : get_option('qcam'))
 
 if qt5_dep.found()
     qcam_deps = [