MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ find_dep_library()

const std::string & MayaFlux::Platform::SystemConfig::find_dep_library ( const std::string &  library_name,
const std::string &  prefix = "" 
)
static

Definition at line 130 of file HostEnvironment.cpp.

131{
132 static std::unordered_map<std::string, std::string> cache;
133
134 auto it = cache.find(library_name);
135 if (it != cache.end()) {
136 return it->second;
137 }
138
139 std::string& result = cache[library_name];
140 std::string search_name = format_library_name(library_name, LibraryType::Shared);
141
142 const fs::path resolved_prefix(prefix);
143 for (const auto& subdir : { "lib", "lib64", "bin" }) {
144 fs::path candidate = resolved_prefix / subdir / search_name;
145 if (fs::exists(candidate)) {
146 result = candidate.string();
147 return result;
148 }
149 }
150
151 for (const auto& lib_path : get_system_libraries()) {
152 fs::path candidate = fs::path(lib_path) / search_name;
153 if (fs::exists(candidate)) {
154 result = candidate.string();
155 return result;
156 }
157 }
158
159 return result;
160}
static const std::vector< std::string > & get_system_libraries()
static std::string format_library_name(const std::string &library_name, LibraryType type=LibraryType::Static)

References format_library_name(), get_system_libraries(), and Shared.

Referenced by Lila::ClangInterpreter::initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: