[libcamera-devel] [RFC PATCH 6/6] meson: ipa: Build documentation cpp files from mojom files

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Tue May 25 11:46:27 CEST 2021


Hi Laurent,

On Mon, May 24, 2021 at 04:28:27PM +0300, Laurent Pinchart wrote:
> Hi Paul,
> 
> Thank you for the patch.
> 
> On Mon, May 24, 2021 at 05:40:29PM +0900, Paul Elder wrote:
> > Plumb meson to build the cpp files from the mojom files for the purpose
> > of containing the documentation for the IPA interfaces.
> > 
> > Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> > ---
> >  src/libcamera/ipa/meson.build | 18 +++++++++++++++---
> >  1 file changed, 15 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/libcamera/ipa/meson.build b/src/libcamera/ipa/meson.build
> > index 0a16d197..0d649eed 100644
> > --- a/src/libcamera/ipa/meson.build
> > +++ b/src/libcamera/ipa/meson.build
> > @@ -1,5 +1,17 @@
> >  # SPDX-License-Identifier: LGPL-2.1-or-later
> >  
> > -libcamera_ipa_interfaces = files([
> > -    'core_ipa_interface.cpp',
> > -])
> > +libcamera_ipa_interfaces = []
> > +
> > +foreach file : ipa_mojom_files
> > +    name = '@0@'.format(file).split('/')[-1].split('.')[0]
> 
> A bit of a hack, but there's no simple way around it that I can think

Yeah :/

> of. One option would be to use @BASENAME@ below. The second split()[]

ERROR: Tried to create target "@BASENAME at _ipa_interface_cpp", but a
target of that name already exists.

> could also become a .replace('.mojom', '').

ERROR: Unknown method "replace" for a string.

> 
> > +
> > +    # {pipeline}_ipa_interface.cpp
> > +    libcamera_ipa_interfaces += \
> > +        custom_target(name + '_ipa_interface_cpp',
> 
> This would become
> 
>         custom_targer('@BASENAME at _ipa_interface_cpp',
> 
> > +                      input : file,
> > +                      output : name + '_ipa_interface.cpp',
> 
> Similarly here. Untested, and possibly not better.

I think I'll keep what I have here :/

> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>


Thanks,

Paul

> 
> > +                      command : [
> > +                          mojom_docs_extractor,
> > +                          '-o', '@OUTPUT@', '@INPUT@'
> > +                      ])
> > +endforeach


More information about the libcamera-devel mailing list