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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon May 24 15:28:27 CEST 2021


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
of. One option would be to use @BASENAME@ below. The second split()[]
could also become a .replace('.mojom', '').

> +
> +    # {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.

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

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

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list