summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-11-08 13:44:20 +0000
committerNaushir Patuck <naush@raspberrypi.com>2023-11-29 09:05:38 +0000
commit0455bbbf518cc834bd72ac65e13c9ed40bf21f3c (patch)
tree97fec38bd5b40cf14e411f425fd31261b4124351 /include
parentbba4ec63c4b0699b7f7ffb20e4f37af2b996d355 (diff)
build: controls: Rework how controls and properties are generated
Add support for using separate YAML files for controls and properties generation. The mapping of vendor/pipeline handler to control file is done through the controls_map variable in include/libcamera/meson.build. This simplifies management of vendor control definitions and avoids possible merge conflicts when changing the control_ids.yaml file for core and draft controls. With this change, libcamera and draft controls and properties files are designated the 'libcamera' vendor tag. In this change, we also rename control_ids.yaml -> control_ids_core.yaml and property_ids.yaml -> property_ids_core.yaml to designate these as core libcamera controls. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/meson.build50
1 files changed, 41 insertions, 9 deletions
diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
index 5fb772e6..c46a4e70 100644
--- a/include/libcamera/meson.build
+++ b/include/libcamera/meson.build
@@ -32,22 +32,54 @@ install_headers(libcamera_public_headers,
libcamera_headers_install_dir = get_option('includedir') / libcamera_include_dir
-# control_ids.h and property_ids.h and associated modes
-control_source_files = {
- 'control_ids': 'controls',
- 'property_ids': 'properties',
+controls_map = {
+ 'controls': {
+ 'core': 'control_ids_core.yaml',
+ },
+
+ 'properties': {
+ 'core': 'property_ids_core.yaml',
+ }
}
control_headers = []
+controls_files = []
+properties_files = []
+
+foreach mode, entry : controls_map
+ files_list = []
+ input_files = []
+ foreach vendor, header : entry
+ if vendor != 'core' and vendor != 'draft'
+ if vendor not in pipelines
+ continue
+ endif
+ endif
+
+ if header in files_list
+ continue
+ endif
+
+ files_list += header
+ input_files += files('../../src/libcamera/' + header)
+ endforeach
+
+ outfile = ''
+ if mode == 'controls'
+ outfile = 'control_ids.h'
+ controls_files += files_list
+ else
+ outfile = 'property_ids.h'
+ properties_files += files_list
+ endif
-foreach header, mode : control_source_files
- input_files = files('../../src/libcamera/' + header +'.yaml')
- template_file = files(header + '.h.in')
+ template_file = files(outfile + '.in')
control_headers += custom_target(header + '_h',
input : input_files,
- output : header + '.h',
+ output : outfile,
command : [gen_controls, '-o', '@OUTPUT@',
- '--mode', mode, '-t', template_file, '@INPUT@'],
+ '--mode', mode, '-t', template_file,
+ '@INPUT@'],
install : true,
install_dir : libcamera_headers_install_dir)
endforeach