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

Kieran Bingham kieran.bingham at ideasonboard.com
Tue May 10 17:21:07 CEST 2022


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.
---
 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
 
-- 
2.25.1



More information about the libcamera-devel mailing list