libcamera: ipa_manager: Search for IPA libraries in build tree
When libcamera is built and tested (or used at all) before installing to the configured prefix path, it will be unable to locate the IPA binaries, or IPA binaries previously installed in the system paths may be incorrect to load. Utilise the build_rpath dynamic tag which is stripped out by meson at install time to determine at runtime if the library currently executing has been installed or not. When not installed and running from a build tree, identify the location of that tree by finding the path of the active libcamera.so itself, and from that point add a relative path to be able to load the most recently built IPA modules. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -107,11 +107,17 @@ if get_option('android')
|
||||
libcamera_link_with += android_camera_metadata
|
||||
endif
|
||||
|
||||
# We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.
|
||||
# The build_rpath is stripped at install time by meson, so we determine at
|
||||
# runtime if the library is running from an installed location by checking
|
||||
# for the presence or abscence of the dynamic tag.
|
||||
|
||||
libcamera = shared_library('camera',
|
||||
libcamera_sources,
|
||||
install : true,
|
||||
link_with : libcamera_link_with,
|
||||
include_directories : includes,
|
||||
build_rpath : '/',
|
||||
dependencies : libcamera_deps)
|
||||
|
||||
libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_ipa_api, libcamera_h],
|
||||
|
||||
Reference in New Issue
Block a user