[libcamera-devel] [PATCH v2] meson: Summarize which applications and adaptation layers are built
Hirokazu Honda
hiroh at chromium.org
Thu Mar 25 05:50:02 CET 2021
On Wed, Mar 24, 2021 at 7:30 PM Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
>
> Hi Hiro,
>
> On Wed, Mar 24, 2021 at 03:23:17PM +0900, Hirokazu Honda wrote:
> > On Wed, Mar 24, 2021 at 5:15 AM Laurent Pinchart wrote:
> > >
> > > Add the application and adaptation layers being built to the meson
> > > summary. The summary now prints
> > >
> > > libcamera 0.0.0
> > >
> > > Configuration
> > > Enabled pipelines: ipu3
> > > raspberrypi
> > > rkisp1
> > > simple
> > > uvcvideo
> > > vimc
> > >
> > > Android support: True
> > > GStreamer support: True
> > > V4L2 emulation support: True
> > > cam application: True
> > > qcam application: True
> > > Unit tests: True
> > >
> > > Subprojects
> > > libyuv: YES
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > > ---
> > > Changes since v1:
> > >
> > > - Add Android support and unit tests
> > > ---
> > > meson.build | 6 ++++++
> > > src/cam/meson.build | 3 +++
> > > src/gstreamer/meson.build | 3 +++
> > > src/qcam/meson.build | 3 +++
> > > src/v4l2/meson.build | 3 +++
> > > test/meson.build | 3 +++
> > > 6 files changed, 21 insertions(+)
> > >
> > > diff --git a/meson.build b/meson.build
> > > index 1768f6eaf98e..3a615ae37c8a 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -168,4 +168,10 @@ py_mod.find_installation('python3', modules: py_modules)
> > > ## Summarise Configurations
> > > summary({
> > > 'Enabled pipelines': pipelines,
> > > + 'Android support': android_enabled,
> > > + 'GStreamer support': gst_enabled,
> > > + 'V4L2 emulation support': v4l2_enabled,
> > > + 'cam application': cam_enabled,
> > > + 'qcam application': qcam_enabled,
> > > + 'Unit tests': test_enabled,
> > > }, section : 'Configuration')
> > > diff --git a/src/cam/meson.build b/src/cam/meson.build
> > > index 65784beda4e6..5e1a7f387d60 100644
> > > --- a/src/cam/meson.build
> > > +++ b/src/cam/meson.build
> > > @@ -3,9 +3,12 @@
> > > libevent = dependency('libevent_pthreads', required : get_option('cam'))
> > >
> > > if not libevent.found()
> > > + cam_enabled = false
> > > subdir_done()
> > > endif
> > >
> > > +cam_enabled = true
> > > +
> >
> > I would initialize true first as below. Ditto for other places.
> >
> > cam_enabled = true
> >
> > if not libevent.found()
> > cam_enabled = false
> > subdir_done()
> > endif
>
> Out of curiosity, why do you think this would be better ? From a
> functional point of view it makes no difference. Setting the variable
> before the check causes a double assignment in the case the feature is
> disabled, but there's no way I will argue that performance is important
> here :-). I don't mind much either way.
>
Well, I don't mind much either way too.
I feel strangeness if |cam_enabled| first appears in if-block because
the scope seems to be within the if-block.
Indeed, I know there is no scope matter as it is kind of a global variable.
The recommendation is just my preference.
-Hiro
> > > cam_sources = files([
> > > 'buffer_writer.cpp',
> > > 'capture.cpp',
> > > diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build
> > > index ea246dcdaa37..8cc811f84c8a 100644
> > > --- a/src/gstreamer/meson.build
> > > +++ b/src/gstreamer/meson.build
> > > @@ -9,9 +9,12 @@ gstallocator_dep = dependency('gstreamer-allocators-1.0', version : gst_dep_vers
> > > required : get_option('gstreamer'))
> > >
> > > if not glib_dep.found() or not gstvideo_dep.found() or not gstallocator_dep.found()
> > > + gst_enabled = false
> > > subdir_done()
> > > endif
> > >
> > > +gst_enabled = true
> > > +
> > > libcamera_gst_sources = [
> > > 'gstlibcamera-utils.cpp',
> > > 'gstlibcamera.cpp',
> > > diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> > > index df4ca988bfaa..acde7682162e 100644
> > > --- a/src/qcam/meson.build
> > > +++ b/src/qcam/meson.build
> > > @@ -8,9 +8,12 @@ qt5_dep = dependency('qt5',
> > > version : '>=5.4')
> > >
> > > if not qt5_dep.found()
> > > + qcam_enabled = false
> > > subdir_done()
> > > endif
> > >
> > > +qcam_enabled = true
> > > +
> > > qcam_sources = files([
> > > '../cam/options.cpp',
> > > '../cam/stream_options.cpp',
> > > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
> > > index c8b794247560..0accac194be4 100644
> > > --- a/src/v4l2/meson.build
> > > +++ b/src/v4l2/meson.build
> > > @@ -1,9 +1,12 @@
> > > # SPDX-License-Identifier: CC0-1.0
> > >
> > > if not get_option('v4l2')
> > > + v4l2_enabled = false
> > > subdir_done()
> > > endif
> > >
> > > +v4l2_enabled = true
> > > +
> > > v4l2_compat_sources = files([
> > > 'v4l2_camera.cpp',
> > > 'v4l2_camera_file.cpp',
> > > diff --git a/test/meson.build b/test/meson.build
> > > index 310b7cad0600..045ad2a2d7c9 100644
> > > --- a/test/meson.build
> > > +++ b/test/meson.build
> > > @@ -1,9 +1,12 @@
> > > # SPDX-License-Identifier: CC0-1.0
> > >
> > > if not get_option('test')
> > > + test_enabled = false
> > > subdir_done()
> > > endif
> > >
> > > +test_enabled = true
> > > +
> > > subdir('libtest')
> > >
> > > subdir('camera')
> >
> > Reviewed-by: Hirokazu Honda <hiroh at chromium.org>
>
> --
> Regards,
>
> Laurent Pinchart
More information about the libcamera-devel
mailing list