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

◆ resolve_dependency_include()

std::string MayaFlux::Platform::SystemConfig::resolve_dependency_include ( const DependencyHint & hint)
inlinestatic

Definition at line 333 of file Toolchain.hpp.

334{
335 const auto is_hit = [&hint](const fs::path& dir) {
336 return fs::exists(hint.marker_file.empty() ? dir : dir / hint.marker_file);
337 };
338
339 if (!hint.vendored_root.empty() && is_hit(fs::path(hint.vendored_root))) {
340 return hint.vendored_root;
341 }
342
343 if (!hint.env_hint.empty() && is_hit(fs::path(hint.env_hint))) {
344 return std::string(hint.env_hint);
345 }
346
347 for (const auto& path : hint.fallback_paths) {
348 if (is_hit(fs::path(path))) {
349 return path;
350 }
351 }
352
353 for (const auto& include : get_system_includes()) {
354 for (const auto& suffix : hint.system_include_suffixes) {
355 const fs::path candidate = suffix.empty()
356 ? fs::path(include)
357 : fs::path(include) / suffix;
358 if (is_hit(candidate)) {
359 return candidate.string();
360 }
361 }
362 }
363
364 return {};
365}
static std::vector< std::string > get_system_includes()
The system include directories, in search order.

References MayaFlux::Platform::DependencyHint::env_hint, MayaFlux::Platform::DependencyHint::fallback_paths, get_system_includes(), MayaFlux::Platform::DependencyHint::marker_file, MayaFlux::Platform::DependencyHint::system_include_suffixes, and MayaFlux::Platform::DependencyHint::vendored_root.

Referenced by get_dep_includes().

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