[libcamera-devel] [PATCH v3 2/2] meson: Add download_subprojects option

Jacopo Mondi jacopo at jmondi.org
Wed Feb 3 12:41:07 CET 2021


Hi Hiro,
  I'm absolutely not the best person to review build system
changes, but..

On Wed, Feb 03, 2021 at 06:51:28AM +0000, Hirokazu Honda wrote:
> This adds download_subprojects option. It controls whether a
> library in meson subprojects is downloaded as specified. The
> motivation of the option is there is an environment where
> the download is prohibited by "--wrap-mode nodownload".
> The local library code (e.g. libyuv) is built with in such a
> build environment if download_subprojects is set to false.
>
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> ---
>  meson_options.txt       |  5 +++++
>  src/android/meson.build | 32 ++++++++++++++++++--------------
>  2 files changed, 23 insertions(+), 14 deletions(-)
>
> diff --git a/meson_options.txt b/meson_options.txt
> index 53f2675e..bd92475f 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -14,6 +14,11 @@ option('gstreamer',
>          value : 'auto',
>          description : 'Compile libcamera GStreamer plugin')
>
> +option('download_subprojects',
> +        type : 'boolean',
> +        value : 'true',
> +        description: 'Download subprojects in build')
> +
>  option('pipelines',
>          type : 'array',
>          choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc'],
> diff --git a/src/android/meson.build b/src/android/meson.build
> index 7619517a..03d847ee 100644
> --- a/src/android/meson.build
> +++ b/src/android/meson.build
> @@ -15,20 +15,24 @@ foreach dep : android_deps
>  endforeach
>
>  if android_enabled
> -    cmake = import('cmake')
> -
> -    libyuv_vars = cmake.subproject_options()
> -    libyuv_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})
> -    libyuv_vars.set_override_option('cpp_std', 'c++17')
> -    libyuv_vars.append_compile_args('cpp',
> -         '-Wno-sign-compare',
> -         '-Wno-unused-variable',
> -         '-Wno-unused-parameter')
> -    libyuv_vars.append_link_args('-ljpeg')
> -    libyuv = cmake.subproject('libyuv', options : libyuv_vars)
> -    libyuv_dep = libyuv.dependency('yuv')
> -
> -    android_deps += [ libyuv_dep, ]
> +    if get_option('download_subprojects')
> +        cmake = import('cmake')
> +
> +        libyuv_vars = cmake.subproject_options()
> +        libyuv_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})
> +        libyuv_vars.set_override_option('cpp_std', 'c++17')
> +        libyuv_vars.append_compile_args('cpp',
> +             '-Wno-sign-compare',
> +             '-Wno-unused-variable',
> +             '-Wno-unused-parameter')
> +        libyuv_vars.append_link_args('-ljpeg')
> +        libyuv = cmake.subproject('libyuv', options : libyuv_vars)
> +        libyuv_dep = libyuv.dependency('yuv')
> +
> +        android_deps += [ libyuv_dep, ]
> +   else
> +        android_deps += [ dependency('libyuv') ]

I'm not sure I know the difference between the last two lines, but
that's me.

The rest looks ok to me
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

> +   endif
>  endif
>
>  android_hal_sources = files([
> --
> 2.30.0.365.g02bc693789-goog
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list