[libcamera-devel] libcamera: meson: Allow PH to change libcamera_deps
diff mbox series

Message ID 20230608133325.68591-1-jacopo.mondi@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel] libcamera: meson: Allow PH to change libcamera_deps
Related show

Commit Message

Jacopo Mondi June 8, 2023, 1:33 p.m. UTC
From: Naushir Patuck <naush@raspberrypi.com>

Pipeline handlers can have custom dependencies.

Allow each pipeline handler subdir to add them to libcamera_deps[].

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/libcamera/meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.40.1

Comments

Laurent Pinchart June 8, 2023, 2:48 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Thu, Jun 08, 2023 at 03:33:25PM +0200, Jacopo Mondi via libcamera-devel wrote:
> From: Naushir Patuck <naush@raspberrypi.com>
> 
> Pipeline handlers can have custom dependencies.
> 
> Allow each pipeline handler subdir to add them to libcamera_deps[].

I wonder how meson will handle the case where multiple pipeline handlers
will add the same dependency. Is this something you've tested ?

> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/libcamera/meson.build | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index d438504198fe..3cd424779395 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -58,6 +58,8 @@ includes = [
>      libcamera_includes,
>  ]
> 
> +libcamera_deps = []
> +
>  libatomic = cc.find_library('atomic', required : false)
>  libthreads = dependency('threads')
> 
> @@ -154,7 +156,7 @@ if ipa_sign_module
>      libcamera_sources += ipa_pub_key_cpp
>  endif
> 
> -libcamera_deps = [
> +libcamera_deps += [
>      libatomic,
>      libcamera_base,
>      libcamera_base_private,
Jacopo Mondi June 14, 2023, 11:45 a.m. UTC | #2
Hi Laurent

On Thu, Jun 08, 2023 at 05:48:01PM +0300, Laurent Pinchart wrote:
> Hi Jacopo,
>
> Thank you for the patch.
>
> On Thu, Jun 08, 2023 at 03:33:25PM +0200, Jacopo Mondi via libcamera-devel wrote:
> > From: Naushir Patuck <naush@raspberrypi.com>
> >
> > Pipeline handlers can have custom dependencies.
> >
> > Allow each pipeline handler subdir to add them to libcamera_deps[].
>
> I wonder how meson will handle the case where multiple pipeline handlers
> will add the same dependency. Is this something you've tested ?
>

It doesn't seem to bother meson at all

--- a/src/libcamera/pipeline/rkisp1/meson.build
+++ b/src/libcamera/pipeline/rkisp1/meson.build
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: CC0-1.0

+libcamera_deps += [ libatomic ]
 libcamera_sources += files([
     'rkisp1.cpp',
     'rkisp1_path.cpp',
diff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build
index 2391b6a9729e..b3febd9a90ad 100644
--- a/src/libcamera/pipeline/rpi/meson.build
+++ b/src/libcamera/pipeline/rpi/meson.build
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: CC0-1.0

+libcamera_deps += [ libatomic ]
+
 subdir('common')


    Enabled pipelines        : rpi/vc4
                               rkisp1

Compiles fine

> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > ---
> >  src/libcamera/meson.build | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > index d438504198fe..3cd424779395 100644
> > --- a/src/libcamera/meson.build
> > +++ b/src/libcamera/meson.build
> > @@ -58,6 +58,8 @@ includes = [
> >      libcamera_includes,
> >  ]
> >
> > +libcamera_deps = []
> > +
> >  libatomic = cc.find_library('atomic', required : false)
> >  libthreads = dependency('threads')
> >
> > @@ -154,7 +156,7 @@ if ipa_sign_module
> >      libcamera_sources += ipa_pub_key_cpp
> >  endif
> >
> > -libcamera_deps = [
> > +libcamera_deps += [
> >      libatomic,
> >      libcamera_base,
> >      libcamera_base_private,
>
> --
> Regards,
>
> Laurent Pinchart
Kieran Bingham June 15, 2023, 11:09 a.m. UTC | #3
Quoting Jacopo Mondi via libcamera-devel (2023-06-14 12:45:38)
> Hi Laurent
> 
> On Thu, Jun 08, 2023 at 05:48:01PM +0300, Laurent Pinchart wrote:
> > Hi Jacopo,
> >
> > Thank you for the patch.
> >
> > On Thu, Jun 08, 2023 at 03:33:25PM +0200, Jacopo Mondi via libcamera-devel wrote:
> > > From: Naushir Patuck <naush@raspberrypi.com>
> > >
> > > Pipeline handlers can have custom dependencies.
> > >
> > > Allow each pipeline handler subdir to add them to libcamera_deps[].
> >
> > I wonder how meson will handle the case where multiple pipeline handlers
> > will add the same dependency. Is this something you've tested ?
> >
> 
> It doesn't seem to bother meson at all

Seems reasonable to me:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> --- a/src/libcamera/pipeline/rkisp1/meson.build
> +++ b/src/libcamera/pipeline/rkisp1/meson.build
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: CC0-1.0
> 
> +libcamera_deps += [ libatomic ]
>  libcamera_sources += files([
>      'rkisp1.cpp',
>      'rkisp1_path.cpp',
> diff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build
> index 2391b6a9729e..b3febd9a90ad 100644
> --- a/src/libcamera/pipeline/rpi/meson.build
> +++ b/src/libcamera/pipeline/rpi/meson.build
> @@ -1,5 +1,7 @@
>  # SPDX-License-Identifier: CC0-1.0
> 
> +libcamera_deps += [ libatomic ]
> +
>  subdir('common')
> 
> 
>     Enabled pipelines        : rpi/vc4
>                                rkisp1
> 
> Compiles fine
> 
> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > ---
> > >  src/libcamera/meson.build | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > > index d438504198fe..3cd424779395 100644
> > > --- a/src/libcamera/meson.build
> > > +++ b/src/libcamera/meson.build
> > > @@ -58,6 +58,8 @@ includes = [
> > >      libcamera_includes,
> > >  ]
> > >
> > > +libcamera_deps = []
> > > +
> > >  libatomic = cc.find_library('atomic', required : false)
> > >  libthreads = dependency('threads')
> > >
> > > @@ -154,7 +156,7 @@ if ipa_sign_module
> > >      libcamera_sources += ipa_pub_key_cpp
> > >  endif
> > >
> > > -libcamera_deps = [
> > > +libcamera_deps += [
> > >      libatomic,
> > >      libcamera_base,
> > >      libcamera_base_private,
> >
> > --
> > Regards,
> >
> > Laurent Pinchart
Laurent Pinchart June 19, 2023, 9:46 a.m. UTC | #4
Hi Jacopo,

On Wed, Jun 14, 2023 at 01:45:38PM +0200, Jacopo Mondi wrote:
> On Thu, Jun 08, 2023 at 05:48:01PM +0300, Laurent Pinchart wrote:
> > On Thu, Jun 08, 2023 at 03:33:25PM +0200, Jacopo Mondi via libcamera-devel wrote:
> > > From: Naushir Patuck <naush@raspberrypi.com>
> > >
> > > Pipeline handlers can have custom dependencies.
> > >
> > > Allow each pipeline handler subdir to add them to libcamera_deps[].
> >
> > I wonder how meson will handle the case where multiple pipeline handlers
> > will add the same dependency. Is this something you've tested ?
> 
> It doesn't seem to bother meson at all
> 
> --- a/src/libcamera/pipeline/rkisp1/meson.build
> +++ b/src/libcamera/pipeline/rkisp1/meson.build
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: CC0-1.0
> 
> +libcamera_deps += [ libatomic ]
>  libcamera_sources += files([
>      'rkisp1.cpp',
>      'rkisp1_path.cpp',
> diff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build
> index 2391b6a9729e..b3febd9a90ad 100644
> --- a/src/libcamera/pipeline/rpi/meson.build
> +++ b/src/libcamera/pipeline/rpi/meson.build
> @@ -1,5 +1,7 @@
>  # SPDX-License-Identifier: CC0-1.0
> 
> +libcamera_deps += [ libatomic ]
> +
>  subdir('common')
> 
> 
>     Enabled pipelines        : rpi/vc4
>                                rkisp1
> 
> Compiles fine

Should be fine then.

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

I wonder if meson ends up adding -latomic twice on the command line.

> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > ---
> > >  src/libcamera/meson.build | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > > index d438504198fe..3cd424779395 100644
> > > --- a/src/libcamera/meson.build
> > > +++ b/src/libcamera/meson.build
> > > @@ -58,6 +58,8 @@ includes = [
> > >      libcamera_includes,
> > >  ]
> > >
> > > +libcamera_deps = []
> > > +
> > >  libatomic = cc.find_library('atomic', required : false)
> > >  libthreads = dependency('threads')
> > >
> > > @@ -154,7 +156,7 @@ if ipa_sign_module
> > >      libcamera_sources += ipa_pub_key_cpp
> > >  endif
> > >
> > > -libcamera_deps = [
> > > +libcamera_deps += [
> > >      libatomic,
> > >      libcamera_base,
> > >      libcamera_base_private,
Jacopo Mondi June 19, 2023, 9:54 a.m. UTC | #5
Hi Laurent

On Mon, Jun 19, 2023 at 12:46:39PM +0300, Laurent Pinchart wrote:
> Hi Jacopo,
>
> On Wed, Jun 14, 2023 at 01:45:38PM +0200, Jacopo Mondi wrote:
> > On Thu, Jun 08, 2023 at 05:48:01PM +0300, Laurent Pinchart wrote:
> > > On Thu, Jun 08, 2023 at 03:33:25PM +0200, Jacopo Mondi via libcamera-devel wrote:
> > > > From: Naushir Patuck <naush@raspberrypi.com>
> > > >
> > > > Pipeline handlers can have custom dependencies.
> > > >
> > > > Allow each pipeline handler subdir to add them to libcamera_deps[].
> > >
> > > I wonder how meson will handle the case where multiple pipeline handlers
> > > will add the same dependency. Is this something you've tested ?
> >
> > It doesn't seem to bother meson at all
> >
> > --- a/src/libcamera/pipeline/rkisp1/meson.build
> > +++ b/src/libcamera/pipeline/rkisp1/meson.build
> > @@ -1,5 +1,6 @@
> >  # SPDX-License-Identifier: CC0-1.0
> >
> > +libcamera_deps += [ libatomic ]
> >  libcamera_sources += files([
> >      'rkisp1.cpp',
> >      'rkisp1_path.cpp',
> > diff --git a/src/libcamera/pipeline/rpi/meson.build b/src/libcamera/pipeline/rpi/meson.build
> > index 2391b6a9729e..b3febd9a90ad 100644
> > --- a/src/libcamera/pipeline/rpi/meson.build
> > +++ b/src/libcamera/pipeline/rpi/meson.build
> > @@ -1,5 +1,7 @@
> >  # SPDX-License-Identifier: CC0-1.0
> >
> > +libcamera_deps += [ libatomic ]
> > +
> >  subdir('common')
> >
> >
> >     Enabled pipelines        : rpi/vc4
> >                                rkisp1
> >
> > Compiles fine
>
> Should be fine then.
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> I wonder if meson ends up adding -latomic twice on the command line.

Apparently it does not. I'm surprised as well by meson's smartness in
this case

[23/108] c++  -o src/libcamera/base/libcamera-base.so.0.0.5 src/libcamera/base/libcamera-base.so.0.0.5.p/backtrace.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/class.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/bound_method.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/event_dispatcher.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/event_dispatcher_poll.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/event_notifier.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/file.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/flags.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/log.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/message.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/mutex.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/object.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/semaphore.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/shared_fd.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/signal.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/thread.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/timer.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/unique_fd.cpp.o src/libcamera/base/libcamera-base.so.0.0.5.p/utils.cpp.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libcamera-base.so.0.0.5 -Wno-redundant-move -Wshadow -include /libcamera/libcamera.git/build/config.h -latomic /usr/lib/libdw.so /usr/lib/libelf.so -pthread /usr/lib/libunwind.so -Wl,--end-group


>
> > > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > ---
> > > >  src/libcamera/meson.build | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > > > index d438504198fe..3cd424779395 100644
> > > > --- a/src/libcamera/meson.build
> > > > +++ b/src/libcamera/meson.build
> > > > @@ -58,6 +58,8 @@ includes = [
> > > >      libcamera_includes,
> > > >  ]
> > > >
> > > > +libcamera_deps = []
> > > > +
> > > >  libatomic = cc.find_library('atomic', required : false)
> > > >  libthreads = dependency('threads')
> > > >
> > > > @@ -154,7 +156,7 @@ if ipa_sign_module
> > > >      libcamera_sources += ipa_pub_key_cpp
> > > >  endif
> > > >
> > > > -libcamera_deps = [
> > > > +libcamera_deps += [
> > > >      libatomic,
> > > >      libcamera_base,
> > > >      libcamera_base_private,
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index d438504198fe..3cd424779395 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -58,6 +58,8 @@  includes = [
     libcamera_includes,
 ]

+libcamera_deps = []
+
 libatomic = cc.find_library('atomic', required : false)
 libthreads = dependency('threads')

@@ -154,7 +156,7 @@  if ipa_sign_module
     libcamera_sources += ipa_pub_key_cpp
 endif

-libcamera_deps = [
+libcamera_deps += [
     libatomic,
     libcamera_base,
     libcamera_base_private,