mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
build: ipa: Fix bug in building multiple IPA interfaces with the same mojom file
In the existing meson scripts, an IPA mojom interface file may not be
built if:
- There are duplicate entries for the mojom file shared by different
pipeline handlers in pipeline_ipa_mojom_mapping, and
- The IPA is not listed first in pipeline_ipa_mojom_mapping, and
- The first listed IPA for the given mojom file is not selected in the
build.
Fix this by using a separate list of already built mojom files
(mojoms_built) instead of overloading use of the existing
ipa_mojom_files list. Now, ipa_mojom_files gets filled in outside of
the IPA list enumeration loop, this also guarantees the IPA
documentation gets built even if the pipeline is not selected.
Fixes: 312e9910ba
("meson: ipa: Add mapping for pipeline handler to mojom interface file")
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
9535f2c745
commit
2ec7f2fede
1 changed files with 12 additions and 7 deletions
|
@ -68,29 +68,28 @@ pipeline_ipa_mojom_mapping = {
|
||||||
'vimc': 'vimc.mojom',
|
'vimc': 'vimc.mojom',
|
||||||
}
|
}
|
||||||
|
|
||||||
ipa_mojom_files = []
|
|
||||||
ipa_mojoms = []
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate headers from templates.
|
# Generate headers from templates.
|
||||||
#
|
#
|
||||||
|
|
||||||
# TODO Define per-pipeline ControlInfoMap with yaml?
|
# TODO Define per-pipeline ControlInfoMap with yaml?
|
||||||
|
|
||||||
|
ipa_mojoms = []
|
||||||
|
mojoms_built = []
|
||||||
foreach pipeline, file : pipeline_ipa_mojom_mapping
|
foreach pipeline, file : pipeline_ipa_mojom_mapping
|
||||||
name = file.split('.')[0]
|
name = file.split('.')[0]
|
||||||
|
|
||||||
# Ensure we do not build duplicate mojom modules
|
# Avoid building duplicate mojom interfaces with the same interface file
|
||||||
if file in ipa_mojom_files
|
if name in mojoms_built
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ipa_mojom_files += file
|
|
||||||
|
|
||||||
if pipeline not in pipelines
|
if pipeline not in pipelines
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
mojoms_built += name
|
||||||
|
|
||||||
# {interface}.mojom-module
|
# {interface}.mojom-module
|
||||||
mojom = custom_target(name + '_mojom_module',
|
mojom = custom_target(name + '_mojom_module',
|
||||||
input : file,
|
input : file,
|
||||||
|
@ -155,6 +154,12 @@ foreach pipeline, file : pipeline_ipa_mojom_mapping
|
||||||
libcamera_generated_ipa_headers += [header, serializer, proxy_header]
|
libcamera_generated_ipa_headers += [header, serializer, proxy_header]
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
ipa_mojom_files = []
|
||||||
|
foreach pipeline, file : pipeline_ipa_mojom_mapping
|
||||||
|
if file not in ipa_mojom_files
|
||||||
|
ipa_mojom_files += file
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
ipa_mojom_files = files(ipa_mojom_files)
|
ipa_mojom_files = files(ipa_mojom_files)
|
||||||
|
|
||||||
# Pass this to the documentation generator in src/libcamera/ipa
|
# Pass this to the documentation generator in src/libcamera/ipa
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue