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

◆ get_clang_resource_dir()

std::string MayaFlux::Platform::SystemConfig::get_clang_resource_dir ( )
inlinestatic

The clang resource directory, from clang -print-resource-dir, or empty.

Definition at line 215 of file Toolchain.hpp.

216{
217 static Memory::SnapshotCell<std::string> cache;
218
219 return detail::memoize_nonempty(cache, [] {
220 auto result = exec_command("clang -print-resource-dir");
221 trim_output(result);
222
223 if (!result.empty()
224 && (result.find("error:") == std::string::npos)
225 && (result.find("clang") != std::string::npos
226 || result.find("lib") != std::string::npos
227 || fs::exists(result))) {
228 return result;
229 }
230 return std::string {};
231 });
232}
T memoize_nonempty(Memory::SnapshotCell< T > &cell, Compute &&compute)
void trim_output(std::string &str)
Definition Process.hpp:52
std::string exec_command(const char *cmd)
Definition Process.hpp:31

References MayaFlux::Platform::exec_command(), MayaFlux::Platform::detail::memoize_nonempty(), and MayaFlux::Platform::trim_output().

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

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