511{
512 std::vector<std::string> lib_paths;
513
514 std::string ld_library_path =
safe_getenv(
"LD_LIBRARY_PATH");
515 if (!ld_library_path.empty()) {
516 std::istringstream
stream(ld_library_path);
517 std::string path;
518 while (std::getline(
stream, path,
':')) {
519 if (!path.empty() && fs::exists(path)) {
520 lib_paths.push_back(path);
521 }
522 }
523 }
524
525 std::vector<std::string> default_paths = {
526#if defined(MAYAFLUX_PLATFORM_MACOS)
527 "/opt/homebrew/lib",
528#endif
529 "/usr/local/lib",
530 "/usr/lib",
531 "/lib",
532 "/usr/local/lib64",
533 "/usr/lib64",
534 "/lib64"
535 };
536
537 for (const auto& path : default_paths) {
538 if (fs::exists(path)) {
539 lib_paths.push_back(path);
540 }
541 }
542
543 return lib_paths;
544}
Core::GlobalStreamInfo stream