@@ -91,10 +91,23 @@ std::string IPAProxy::resolvePath(const std::string &file) const
}
}
- /* Try finding the exec target from the install directory. */
- std::string proxyPath = std::string(IPA_PROXY_DIR) + proxyFile;
- if (!access(proxyPath.c_str(), X_OK))
- return proxyPath;
+ /*
+ * When libcamera is used before it is installed, load proxies from the
+ * same build directory as the libcamera directory itself. This requires
+ * identifying the path of the libcamera.so, and referencing a relative
+ * path for the proxies from that point.
+ */
+ if (!utils::isLibcameraInstalled()) {
+ std::string ipaProxyDir = utils::dirname(utils::libcameraPath()) + "/../../proxy";
+
+ LOG(IPAProxy, Info)
+ << "libcamera is not installed. Adding '"
+ << ipaProxyDir << "' to the Proxy search path";
+
+ std::string proxyPath = ipaProxyDir + proxyFile;
+ if (!access(proxyPath.c_str(), X_OK))
+ return proxyPath;
+ }
return std::string();
}
When libcamera is built and tested before installing, it will be unable to locate the path to proxy files, or previously installed files in the system path may be incorrect to load. Hence, when libcamera is not installed and running from a build tree, identify the location of that tree by using libcameraPath(), and from that point add relative path to the proxy file. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> --- src/libcamera/ipa_proxy.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)