[libcamera-devel,3/3] libcamera: Make pipeline handlers selectable at compile time

Message ID 20200325085805.11749-4-laurent.pinchart@ideasonboard.com
State Accepted
Commit ee7e2c93dfbf34b3500c895115c516e5e90d3e31
Headers show
Series
  • Make pipeline handlers selectable at compile time
Related show

Commit Message

Laurent Pinchart March 25, 2020, 8:58 a.m. UTC
Add a pipelines project option that specifies which pipeline handlers to
compile in. The corresponding IPA modules are automatically selected.
The default is to compile all pipeline handlers.

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

Comments

Kieran Bingham March 25, 2020, 10:17 a.m. UTC | #1
Hi Laurent,

On 25/03/2020 08:58, Laurent Pinchart wrote:
> Add a pipelines project option that specifies which pipeline handlers to

/pipelines/'pipelines'/

Otherwise what is the "pipelines project" you are working on ...

> compile in. The corresponding IPA modules are automatically selected.
> The default is to compile all pipeline handlers.

Nice - and the coding for this is much simpler than I anticipated it
would be.

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

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  meson_options.txt                  |  5 +++++
>  src/ipa/meson.build                | 10 ++++++++--
>  src/libcamera/pipeline/meson.build |  7 +++----
>  3 files changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/meson_options.txt b/meson_options.txt
> index b17b6de6f182..6464df837cc3 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -12,6 +12,11 @@ option('gstreamer',
>          value : 'auto',
>          description : 'Compile libcamera GStreamer plugin')
>  
> +option('pipelines',
> +        type : 'array',
> +        choices : ['ipu3', 'rkisp1', 'uvcvideo', 'vimc'],
> +        description : 'Select which pipeline handlers to include')
> +
>  option('test',
>          type : 'boolean',
>          description: 'Compile and include the tests')
> diff --git a/src/ipa/meson.build b/src/ipa/meson.build
> index 9aaf92494d37..73278a60a99f 100644
> --- a/src/ipa/meson.build
> +++ b/src/ipa/meson.build
> @@ -9,5 +9,11 @@ config_h.set('IPA_MODULE_DIR',
>               '"' + join_paths(get_option('prefix'), ipa_install_dir) + '"')
>  
>  subdir('libipa')
> -subdir('rkisp1')
> -subdir('vimc')
> +
> +ipas = ['rkisp1', 'vimc']
> +
> +foreach pipeline : get_option('pipelines')
> +    if ipas.contains(pipeline)
> +        subdir(pipeline)
> +    endif
> +endforeach
> diff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build
> index c1a6ab0484f0..190ca5a8db92 100644
> --- a/src/libcamera/pipeline/meson.build
> +++ b/src/libcamera/pipeline/meson.build
> @@ -1,4 +1,3 @@
> -subdir('ipu3')
> -subdir('rkisp1')
> -subdir('uvcvideo')
> -subdir('vimc')
> +foreach pipeline : get_option('pipelines')
> +    subdir(pipeline)
> +endforeach
>

Patch

diff --git a/meson_options.txt b/meson_options.txt
index b17b6de6f182..6464df837cc3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -12,6 +12,11 @@  option('gstreamer',
         value : 'auto',
         description : 'Compile libcamera GStreamer plugin')
 
+option('pipelines',
+        type : 'array',
+        choices : ['ipu3', 'rkisp1', 'uvcvideo', 'vimc'],
+        description : 'Select which pipeline handlers to include')
+
 option('test',
         type : 'boolean',
         description: 'Compile and include the tests')
diff --git a/src/ipa/meson.build b/src/ipa/meson.build
index 9aaf92494d37..73278a60a99f 100644
--- a/src/ipa/meson.build
+++ b/src/ipa/meson.build
@@ -9,5 +9,11 @@  config_h.set('IPA_MODULE_DIR',
              '"' + join_paths(get_option('prefix'), ipa_install_dir) + '"')
 
 subdir('libipa')
-subdir('rkisp1')
-subdir('vimc')
+
+ipas = ['rkisp1', 'vimc']
+
+foreach pipeline : get_option('pipelines')
+    if ipas.contains(pipeline)
+        subdir(pipeline)
+    endif
+endforeach
diff --git a/src/libcamera/pipeline/meson.build b/src/libcamera/pipeline/meson.build
index c1a6ab0484f0..190ca5a8db92 100644
--- a/src/libcamera/pipeline/meson.build
+++ b/src/libcamera/pipeline/meson.build
@@ -1,4 +1,3 @@ 
-subdir('ipu3')
-subdir('rkisp1')
-subdir('uvcvideo')
-subdir('vimc')
+foreach pipeline : get_option('pipelines')
+    subdir(pipeline)
+endforeach