MayaFlux 0.4.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 112 of file HostEnvironment.cpp.

113{
114 static std::unordered_map<std::string, std::string> cache;
115
116 auto it = cache.find(library_name);
117 if (it != cache.end()) {
118 return it->second;
119 }
120
121 std::string& result = cache[library_name];
122 std::string search_name = format_library_name(library_name, LibraryType::Shared);
123
124 const fs::path resolved_prefix(prefix);
125 for (const auto& subdir : { "lib", "lib64", "bin" }) {
126 fs::path candidate = resolved_prefix / subdir / search_name;
127 if (fs::exists(candidate)) {
128 result = candidate.string();
129 return result;
130 }
131 }
132
133 for (const auto& lib_path : get_system_libraries()) {
134 fs::path candidate = fs::path(lib_path) / search_name;
135 if (fs::exists(candidate)) {
136 result = candidate.string();
137 return result;
138 }
139 }
140
141 return result;
142}
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: