[libcamera-devel,v4,6/6] v4l2: v4l2_compat: Use correct libcamera_dep dependency

Message ID 20200308000433.2917-7-laurent.pinchart@ideasonboard.com
State Accepted
Commit 20fb72a56eb3afe347ac058c13b8c84fbff1ed40
Headers show
Series
  • Fix race condition and other build issues
Related show

Commit Message

Laurent Pinchart March 8, 2020, 12:04 a.m. UTC
The v4l2-compat shared library is declared as depending on
libcamera_deps. This is not correct, as libcamera_deps contains the
dependencies of libcamera itself. The correct dependency for users of
libcamera is libcamera_dep.

Fixing this allows dropping libcamera_includes from the list of includes
required by v4l2-compat, and libcamera from the link_with list, as they
are already contained in libcamera_dep. We however need to add an
explicit dependency on libdl which was previously provided by
libcamera_deps.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
Changes since v3:

- Inline v4l2_compat_deps and v4l2_compat_includes
- Use the libdl dependency object
---
 src/v4l2/meson.build | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Niklas Söderlund March 8, 2020, 5:34 p.m. UTC | #1
Hi Laurent,

Thanks for your patch.

On 2020-03-08 02:04:33 +0200, Laurent Pinchart wrote:
> The v4l2-compat shared library is declared as depending on
> libcamera_deps. This is not correct, as libcamera_deps contains the
> dependencies of libcamera itself. The correct dependency for users of
> libcamera is libcamera_dep.
> 
> Fixing this allows dropping libcamera_includes from the list of includes
> required by v4l2-compat, and libcamera from the link_with list, as they
> are already contained in libcamera_dep. We however need to add an
> explicit dependency on libdl which was previously provided by
> libcamera_deps.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
> Changes since v3:
> 
> - Inline v4l2_compat_deps and v4l2_compat_includes
> - Use the libdl dependency object
> ---
>  src/v4l2/meson.build | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
> index 14ee3594747d..efab968f7729 100644
> --- a/src/v4l2/meson.build
> +++ b/src/v4l2/meson.build
> @@ -5,11 +5,6 @@ v4l2_compat_sources = files([
>      'v4l2_compat_manager.cpp',
>  ])
>  
> -v4l2_compat_includes = [
> -    libcamera_includes,
> -    libcamera_internal_includes,
> -]
> -
>  v4l2_compat_cpp_args = [
>      # Meson enables large file support unconditionally, which redirect file
>      # operations to 64-bit versions. This results in some symbols being
> @@ -25,7 +20,6 @@ v4l2_compat = shared_library('v4l2-compat',
>                               v4l2_compat_sources,
>                               name_prefix : '',
>                               install : true,
> -                             link_with : libcamera,
> -                             include_directories : v4l2_compat_includes,
> -                             dependencies : libcamera_deps,
> +                             include_directories : libcamera_internal_includes,
> +                             dependencies : [ libcamera_dep, libdl ],
>                               cpp_args : v4l2_compat_cpp_args)
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
index 14ee3594747d..efab968f7729 100644
--- a/src/v4l2/meson.build
+++ b/src/v4l2/meson.build
@@ -5,11 +5,6 @@  v4l2_compat_sources = files([
     'v4l2_compat_manager.cpp',
 ])
 
-v4l2_compat_includes = [
-    libcamera_includes,
-    libcamera_internal_includes,
-]
-
 v4l2_compat_cpp_args = [
     # Meson enables large file support unconditionally, which redirect file
     # operations to 64-bit versions. This results in some symbols being
@@ -25,7 +20,6 @@  v4l2_compat = shared_library('v4l2-compat',
                              v4l2_compat_sources,
                              name_prefix : '',
                              install : true,
-                             link_with : libcamera,
-                             include_directories : v4l2_compat_includes,
-                             dependencies : libcamera_deps,
+                             include_directories : libcamera_internal_includes,
+                             dependencies : [ libcamera_dep, libdl ],
                              cpp_args : v4l2_compat_cpp_args)