[libcamera-devel] libcamera: Use dependency instead of link_args to link against libdl

Message ID 20190605154047.12055-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit a87c63c7e9c7186805ab2f9a16816e65a699bde7
Headers show
Series
  • [libcamera-devel] libcamera: Use dependency instead of link_args to link against libdl
Related show

Commit Message

Laurent Pinchart June 5, 2019, 3:40 p.m. UTC
Instead of specifying the link arguments directly, which may be
compiler-specific, use a dependency object provided by find_library().

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

Comments

Paul Elder June 5, 2019, 4:16 p.m. UTC | #1
Hi Laurent,

Thank you for the patch.

On Wed, Jun 05, 2019 at 06:40:47PM +0300, Laurent Pinchart wrote:
> Instead of specifying the link arguments directly, which may be
> compiler-specific, use a dependency object provided by find_library().
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Looks good to me.

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

> ---
>  src/libcamera/meson.build | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 0889b0d31f36..1ca1083cf5c7 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -63,12 +63,16 @@ if libudev.found()
>      ])
>  endif
>  
> +libcamera_deps = [
> +    cc.find_library('dl'),
> +    libudev,
> +]
> +
>  libcamera = shared_library('camera',
>                             libcamera_sources,
>                             install : true,
>                             include_directories : includes,
> -                           dependencies : libudev,
> -                           link_args : '-ldl')
> +                           dependencies : libcamera_deps)
>  
>  libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_h],
>                                     include_directories : libcamera_includes,
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 0889b0d31f36..1ca1083cf5c7 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -63,12 +63,16 @@  if libudev.found()
     ])
 endif
 
+libcamera_deps = [
+    cc.find_library('dl'),
+    libudev,
+]
+
 libcamera = shared_library('camera',
                            libcamera_sources,
                            install : true,
                            include_directories : includes,
-                           dependencies : libudev,
-                           link_args : '-ldl')
+                           dependencies : libcamera_deps)
 
 libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_h],
                                    include_directories : libcamera_includes,