From b8d318ebeba0710d5a7f8292a02570bb9a886f8b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 7 Aug 2024 19:31:34 +0300 Subject: meson: Store controls and properties YAML files in variables When generating control headers, the YAML files to be used are determined dynamically based on the selected pipeline handlers. As part of this process, the build system populates an array of meson File objects used as an input for the control headers generation custom target, as well as an array of file names (as strings). The file names array is later used to generate the control source files for the libcamera core, as well as the source code for controls support in the Python bindings. Both of the source code generators manually turn the array of file names into File objects. This duplicates code and reduces readability. A third similar implementation has also been proposed to generate control support sources in the GStreamer element, making the issue worse. To simplify this, store File objects instead of file names in the controls_files array. As the meson configuration summary doesn't support File objects, create a separate controls_files_names to store the file names for that sole purpose. The exact same process occurs for properties, address them the same way. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally Reviewed-by: Paul Elder --- include/libcamera/meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index c8c900eb..36de1c2a 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -47,7 +47,9 @@ controls_map = { control_headers = [] controls_files = [] +controls_files_names = [] properties_files = [] +properties_files_names = [] foreach mode, entry : controls_map files_list = [] @@ -70,10 +72,12 @@ foreach mode, entry : controls_map outfile = '' if mode == 'controls' outfile = 'control_ids.h' - controls_files += files_list + controls_files += input_files + controls_files_names += files_list else outfile = 'property_ids.h' - properties_files += files_list + properties_files += input_files + properties_files_names += files_list endif template_file = files(outfile + '.in') -- cgit v1.2.1