[libcamera-devel] [PATCH] py: Fix gen-py-control-enums.py reference

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue May 10 17:36:08 CEST 2022


Hi Kieran,

Thank you for the patch.

On Tue, May 10, 2022 at 05:21:07PM +0200, Kieran Bingham via libcamera-devel wrote:
> Scripts should be referenced using the meson files() directive to ensure
> the location is correctly identified with the relevant paths. This
> prevents compilation failures if the working directory does not match
> the source tree.
> 
> Fixes: 6e92cb9dc49e ("py: Generate control enums from yaml")
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
> It seems in my testing, that this occurs on meson 57 and below, but
> wasn't reproduced on meson 58. This fixes the issue anyway, and ensures
> we are consistent in our usage of scripts internally.
> ---

Looks good to me,

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

I would still like to see a patch to use files() for gen_input_files
too. I understand that Tomi is on it.

>  src/py/libcamera/meson.build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
> index 842db1ed3ddd..0cd7c75bb86c 100644
> --- a/src/py/libcamera/meson.build
> +++ b/src/py/libcamera/meson.build
> @@ -22,10 +22,12 @@ gen_input_files = [
>      'pyenums_generated.cpp.in',
>  ]
>  
> +gen_py_control_enums = files('gen-py-control-enums.py')
> +
>  generated_sources = custom_target('py_gen_controls',
>                                    input : gen_input_files,
>                                    output : ['pyenums_generated.cpp'],
> -                                  command : ['gen-py-control-enums.py', '-o', '@OUTPUT@', '@INPUT@'])
> +                                  command : [gen_py_control_enums, '-o', '@OUTPUT@', '@INPUT@'])
>  
>  pycamera_sources += generated_sources

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list