summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicholas Roth <nicholas@rothemail.net>2022-10-27 22:17:23 -0500
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-10-28 11:56:25 +0100
commit21e6363750bca1de861d7ae33c22fa885139728d (patch)
treeb6fe82ea6476354b3af561ae0d2c3711c1acf118 /src
parente1e6c1b2f6680342c6a243b5a0007f593cd7e793 (diff)
libcamera: make libdl optional when provided
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> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/meson.build7
1 files changed, 6 insertions, 1 deletions
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)