[libcamera-devel] [PATCH] meson: Provide options to disable test/docs

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Mar 21 09:35:32 CET 2019


Hi Kieran,

Thank you for the patch.

On Wed, Mar 20, 2019 at 03:47:48PM +0000, Kieran Bingham wrote:
> It can be desirable to disable the compilation and processing of both
> the test suite and documentation for use cases such as packaging to an
> embedded target.
> 
> Provide a new meson_options.txt file to allow disabling either or both
> of the tests and documentation components of libcamera.
> 
> These options can be provided at the initial configuration time, for
> example:
> 
>   meson build -Dtests=false -Ddocumentation=false
> 
> or by reconfiguring an existing build tree:
> 
>   cd build
>   meson configure -Ddocumentation=false
>   meson configure -Dtests=false
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  meson.build       | 10 ++++++++--
>  meson_options.txt |  2 ++
>  2 files changed, 10 insertions(+), 2 deletions(-)
>  create mode 100644 meson_options.txt
> 
> diff --git a/meson.build b/meson.build
> index 4465a3851a30..43d4a57602bb 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -27,9 +27,15 @@ libcamera_includes = include_directories('include')
>  
>  subdir('include')
>  subdir('src')
> -subdir('test')
>  subdir('utils')
> -subdir('Documentation')
> +
> +if get_option('tests')
> +	subdir('test')
> +endif

meson.build files use spaces for indentation.

> +
> +if get_option('documentation')
> +	subdir('Documentation')
> +endif

I would have kept these alphabetically sorted.

>  pkg_mod = import('pkgconfig')
>  pkg_mod.generate(libraries : libcamera,
> diff --git a/meson_options.txt b/meson_options.txt
> new file mode 100644
> index 000000000000..c5df661a2286
> --- /dev/null
> +++ b/meson_options.txt
> @@ -0,0 +1,2 @@
> +option('tests', type : 'boolean')
> +option('documentation', type : 'boolean')

Shouldn't this be sorted alphabetically ? Please also add descriptions
to those options.

It seems the patch has been pushed already, could you please fix this on
top ?

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list