From 01ddb6d842694c6b65d825c224e2939bedbc78b1 Mon Sep 17 00:00:00 2001 From: Hayodea Hakol Date: Wed, 8 Jan 2025 15:08:23 -0400 Subject: [PATCH] Only search in senseApiLibPath if it's actually set --- hcore/senseApis/senseApiManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hcore/senseApis/senseApiManager.cpp b/hcore/senseApis/senseApiManager.cpp index b400b2c..061577b 100644 --- a/hcore/senseApis/senseApiManager.cpp +++ b/hcore/senseApis/senseApiManager.cpp @@ -16,11 +16,16 @@ static std::optional findLibraryPath( const std::string& libraryPath) { std::vector searchPaths = { - OptionParser::getOptions().senseApiLibPath, fs::current_path().string(), fs::path("/proc/self/exe").parent_path().string() }; + if (!OptionParser::getOptions().senseApiLibPath.empty()) + { + searchPaths.insert( + searchPaths.begin(), OptionParser::getOptions().senseApiLibPath); + } + for (const auto& path : searchPaths) { fs::path fullPath = fs::path(path) / libraryPath;