[libcamera-devel,v1,2/6] qcam: Simplify dependency handling for libtiff
diff mbox series

Message ID 20221019231537.26880-3-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • apps: Avoid duplicate compilation of common code
Related show

Commit Message

Laurent Pinchart Oct. 19, 2022, 11:15 p.m. UTC
There's no need to conditionally add tiff_dep to the list of qcam
dependency, as a not found dependency() is ignored when listed in the
executable dependencies argument.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/qcam/meson.build | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Nicolas Dufresne via libcamera-devel Oct. 20, 2022, 6:33 a.m. UTC | #1
On Thu, Oct 20, 2022 at 02:15:33AM +0300, Laurent Pinchart via libcamera-devel wrote:
> There's no need to conditionally add tiff_dep to the list of qcam
> dependency, as a not found dependency() is ignored when listed in the
> executable dependencies argument.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/qcam/meson.build | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> index 9f5759ff0786..d5916d0df532 100644
> --- a/src/qcam/meson.build
> +++ b/src/qcam/meson.build
> @@ -36,18 +36,11 @@ qcam_resources = files([
>      'assets/feathericons/feathericons.qrc',
>  ])
>  
> -qcam_deps = [
> -    libatomic,
> -    libcamera_public,
> -    qt5_dep,
> -]
> -
>  qt5_cpp_args = ['-DQT_NO_KEYWORDS']
>  
>  tiff_dep = dependency('libtiff-4', required : false)
>  if tiff_dep.found()
>      qt5_cpp_args += ['-DHAVE_TIFF']
> -    qcam_deps += [tiff_dep]
>      qcam_sources += files([
>          '../cam/dng_writer.cpp',
>      ])
> @@ -81,5 +74,10 @@ resources = qt5.preprocess(moc_headers: qcam_moc_headers,
>  
>  qcam  = executable('qcam', qcam_sources, resources,
>                     install : true,
> -                   dependencies : qcam_deps,
> +                   dependencies : [
> +                       libatomic,
> +                       libcamera_public,
> +                       qt5_dep,
> +                       tiff_dep,
> +                   ],
>                     cpp_args : qt5_cpp_args)
Kieran Bingham Oct. 20, 2022, 9 a.m. UTC | #2
Quoting Laurent Pinchart via libcamera-devel (2022-10-20 00:15:33)
> There's no need to conditionally add tiff_dep to the list of qcam
> dependency, as a not found dependency() is ignored when listed in the
> executable dependencies argument.

Hrm ... that sounds counter-intuitive ... but also makes sense.

"I depend on this ... unless you can't find it ... in which case I
dont'..."

I can't immediately find the meson documentation to back that up. If you
found a reference it would be nice to add it here, but not essential.

Have you tested builds both with and without libtiff-4 being available
on the system?

Or do you need it to be explicitly tested?



> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/qcam/meson.build | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> index 9f5759ff0786..d5916d0df532 100644
> --- a/src/qcam/meson.build
> +++ b/src/qcam/meson.build
> @@ -36,18 +36,11 @@ qcam_resources = files([
>      'assets/feathericons/feathericons.qrc',
>  ])
>  
> -qcam_deps = [
> -    libatomic,
> -    libcamera_public,
> -    qt5_dep,
> -]
> -
>  qt5_cpp_args = ['-DQT_NO_KEYWORDS']
>  
>  tiff_dep = dependency('libtiff-4', required : false)
>  if tiff_dep.found()
>      qt5_cpp_args += ['-DHAVE_TIFF']
> -    qcam_deps += [tiff_dep]
>      qcam_sources += files([
>          '../cam/dng_writer.cpp',
>      ])
> @@ -81,5 +74,10 @@ resources = qt5.preprocess(moc_headers: qcam_moc_headers,
>  
>  qcam  = executable('qcam', qcam_sources, resources,
>                     install : true,
> -                   dependencies : qcam_deps,
> +                   dependencies : [
> +                       libatomic,
> +                       libcamera_public,
> +                       qt5_dep,
> +                       tiff_dep,
> +                   ],
>                     cpp_args : qt5_cpp_args)
> -- 
> Regards,
> 
> Laurent Pinchart
>
Laurent Pinchart Oct. 20, 2022, 9:25 a.m. UTC | #3
On Thu, Oct 20, 2022 at 10:00:20AM +0100, Kieran Bingham wrote:
> Quoting Laurent Pinchart via libcamera-devel (2022-10-20 00:15:33)
> > There's no need to conditionally add tiff_dep to the list of qcam
> > dependency, as a not found dependency() is ignored when listed in the
> > executable dependencies argument.
> 
> Hrm ... that sounds counter-intuitive ... but also makes sense.
> 
> "I depend on this ... unless you can't find it ... in which case I
> dont'..."
> 
> I can't immediately find the meson documentation to back that up. If you
> found a reference it would be nice to add it here, but not essential.
> 
> Have you tested builds both with and without libtiff-4 being available
> on the system?
> 
> Or do you need it to be explicitly tested?

I haven't searched the meson documentation for a confirmation, but we
already do that for other dependencies (libdrm, libsdl2, ...), and I've
tested compilation with both libtiff-4 being available and unavailable.

> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  src/qcam/meson.build | 14 ++++++--------
> >  1 file changed, 6 insertions(+), 8 deletions(-)
> > 
> > diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> > index 9f5759ff0786..d5916d0df532 100644
> > --- a/src/qcam/meson.build
> > +++ b/src/qcam/meson.build
> > @@ -36,18 +36,11 @@ qcam_resources = files([
> >      'assets/feathericons/feathericons.qrc',
> >  ])
> >  
> > -qcam_deps = [
> > -    libatomic,
> > -    libcamera_public,
> > -    qt5_dep,
> > -]
> > -
> >  qt5_cpp_args = ['-DQT_NO_KEYWORDS']
> >  
> >  tiff_dep = dependency('libtiff-4', required : false)
> >  if tiff_dep.found()
> >      qt5_cpp_args += ['-DHAVE_TIFF']
> > -    qcam_deps += [tiff_dep]
> >      qcam_sources += files([
> >          '../cam/dng_writer.cpp',
> >      ])
> > @@ -81,5 +74,10 @@ resources = qt5.preprocess(moc_headers: qcam_moc_headers,
> >  
> >  qcam  = executable('qcam', qcam_sources, resources,
> >                     install : true,
> > -                   dependencies : qcam_deps,
> > +                   dependencies : [
> > +                       libatomic,
> > +                       libcamera_public,
> > +                       qt5_dep,
> > +                       tiff_dep,
> > +                   ],
> >                     cpp_args : qt5_cpp_args)
Kieran Bingham Oct. 20, 2022, 9:48 a.m. UTC | #4
Quoting Laurent Pinchart (2022-10-20 10:25:35)
> On Thu, Oct 20, 2022 at 10:00:20AM +0100, Kieran Bingham wrote:
> > Quoting Laurent Pinchart via libcamera-devel (2022-10-20 00:15:33)
> > > There's no need to conditionally add tiff_dep to the list of qcam
> > > dependency, as a not found dependency() is ignored when listed in the
> > > executable dependencies argument.
> > 
> > Hrm ... that sounds counter-intuitive ... but also makes sense.
> > 
> > "I depend on this ... unless you can't find it ... in which case I
> > dont'..."
> > 
> > I can't immediately find the meson documentation to back that up. If you
> > found a reference it would be nice to add it here, but not essential.
> > 
> > Have you tested builds both with and without libtiff-4 being available
> > on the system?
> > 
> > Or do you need it to be explicitly tested?
> 
> I haven't searched the meson documentation for a confirmation, but we
> already do that for other dependencies (libdrm, libsdl2, ...), and I've
> tested compilation with both libtiff-4 being available and unavailable.


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


> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > >  src/qcam/meson.build | 14 ++++++--------
> > >  1 file changed, 6 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/src/qcam/meson.build b/src/qcam/meson.build
> > > index 9f5759ff0786..d5916d0df532 100644
> > > --- a/src/qcam/meson.build
> > > +++ b/src/qcam/meson.build
> > > @@ -36,18 +36,11 @@ qcam_resources = files([
> > >      'assets/feathericons/feathericons.qrc',
> > >  ])
> > >  
> > > -qcam_deps = [
> > > -    libatomic,
> > > -    libcamera_public,
> > > -    qt5_dep,
> > > -]
> > > -
> > >  qt5_cpp_args = ['-DQT_NO_KEYWORDS']
> > >  
> > >  tiff_dep = dependency('libtiff-4', required : false)
> > >  if tiff_dep.found()
> > >      qt5_cpp_args += ['-DHAVE_TIFF']
> > > -    qcam_deps += [tiff_dep]
> > >      qcam_sources += files([
> > >          '../cam/dng_writer.cpp',
> > >      ])
> > > @@ -81,5 +74,10 @@ resources = qt5.preprocess(moc_headers: qcam_moc_headers,
> > >  
> > >  qcam  = executable('qcam', qcam_sources, resources,
> > >                     install : true,
> > > -                   dependencies : qcam_deps,
> > > +                   dependencies : [
> > > +                       libatomic,
> > > +                       libcamera_public,
> > > +                       qt5_dep,
> > > +                       tiff_dep,
> > > +                   ],
> > >                     cpp_args : qt5_cpp_args)
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/src/qcam/meson.build b/src/qcam/meson.build
index 9f5759ff0786..d5916d0df532 100644
--- a/src/qcam/meson.build
+++ b/src/qcam/meson.build
@@ -36,18 +36,11 @@  qcam_resources = files([
     'assets/feathericons/feathericons.qrc',
 ])
 
-qcam_deps = [
-    libatomic,
-    libcamera_public,
-    qt5_dep,
-]
-
 qt5_cpp_args = ['-DQT_NO_KEYWORDS']
 
 tiff_dep = dependency('libtiff-4', required : false)
 if tiff_dep.found()
     qt5_cpp_args += ['-DHAVE_TIFF']
-    qcam_deps += [tiff_dep]
     qcam_sources += files([
         '../cam/dng_writer.cpp',
     ])
@@ -81,5 +74,10 @@  resources = qt5.preprocess(moc_headers: qcam_moc_headers,
 
 qcam  = executable('qcam', qcam_sources, resources,
                    install : true,
-                   dependencies : qcam_deps,
+                   dependencies : [
+                       libatomic,
+                       libcamera_public,
+                       qt5_dep,
+                       tiff_dep,
+                   ],
                    cpp_args : qt5_cpp_args)