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>
This commit is contained in:
Nicholas Roth 2022-10-27 22:17:23 -05:00 committed by Kieran Bingham
parent e1e6c1b2f6
commit 21e6363750

View file

@ -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)