[libcamera-devel,v5,07/10] libcamera: make libdl optional when provided
diff mbox series

Message ID 20221028031726.4849-8-nicholas@rothemail.net
State Accepted
Headers show
Series
  • [libcamera-devel,v5,01/10] ipa: workaround libcxx duration limitation
Related show

Commit Message

Nicolas Dufresne via libcamera-devel Oct. 28, 2022, 3:17 a.m. UTC
From: Nicholas Roth <nicholas@rothemail.net>

Currently, libdl is always required. Sometimes, the C++ runtime includes
a dynamic loader, which is the case for Android. Additionally, Android
11 does not have libdl. This fix allows libcamera to build on Android.

Signed-off-by: Nicholas Roth <nicholas@rothemail.net>
---
 src/libcamera/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Kieran Bingham Oct. 28, 2022, 10:30 a.m. UTC | #1
Quoting Nicholas Roth via libcamera-devel (2022-10-28 04:17:23)
> From: Nicholas Roth <nicholas@rothemail.net>
> 
> Currently, libdl is always required. Sometimes, the C++ runtime includes
> a dynamic loader, which is the case for Android. Additionally, Android
> 11 does not have libdl. This fix allows libcamera to build on Android.
> 
> Signed-off-by: Nicholas Roth <nicholas@rothemail.net>

This is fine with me:


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


And from Jacopo on an earlier version:

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

> ---
>  src/libcamera/meson.build | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 5f39d2e2..0494e808 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -65,7 +65,12 @@ subdir('ipa')
>  subdir('pipeline')
>  subdir('proxy')
>  
> -libdl = cc.find_library('dl')
> +null_dep = dependency('', required : false)
> +
> +libdl = null_dep
> +if not cc.has_function('dlopen')
> +    libdl = cc.find_library('dl')
> +endif
>  libudev = dependency('libudev', required : false)
>  libyaml = dependency('yaml-0.1', required : false)
>  
> -- 
> 2.34.1
>

Patch
diff mbox series

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 5f39d2e2..0494e808 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -65,7 +65,12 @@  subdir('ipa')
 subdir('pipeline')
 subdir('proxy')
 
-libdl = cc.find_library('dl')
+null_dep = dependency('', required : false)
+
+libdl = null_dep
+if not cc.has_function('dlopen')
+    libdl = cc.find_library('dl')
+endif
 libudev = dependency('libudev', required : false)
 libyaml = dependency('yaml-0.1', required : false)