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>
This commit is contained in:
@@ -127,12 +127,23 @@ endif
|
||||
|
||||
control_sources = []
|
||||
|
||||
foreach source, mode : control_source_files
|
||||
input_files = files(source +'.yaml')
|
||||
template_file = files(source + '.cpp.in')
|
||||
control_sources += custom_target(source + '_cpp',
|
||||
controls_mode_files = {
|
||||
'controls' : controls_files,
|
||||
'properties' : properties_files,
|
||||
}
|
||||
|
||||
foreach mode, input_files : controls_mode_files
|
||||
input_files = files(input_files)
|
||||
|
||||
if mode == 'controls'
|
||||
template_file = files('control_ids.cpp.in')
|
||||
else
|
||||
template_file = files('property_ids.cpp.in')
|
||||
endif
|
||||
|
||||
control_sources += custom_target(mode + '_cpp',
|
||||
input : input_files,
|
||||
output : source + '.cpp',
|
||||
output : mode + '_ids.cpp',
|
||||
command : [gen_controls, '-o', '@OUTPUT@',
|
||||
'--mode', mode, '-t', template_file, '@INPUT@'])
|
||||
endforeach
|
||||
|
||||
Reference in New Issue
Block a user