MCPcopy Create free account
hub / github.com/argotorg/solidity / findInDefaultPath

Function findInDefaultPath

test/Common.cpp:75–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75std::optional<fs::path> findInDefaultPath(std::string const& lib_name)
76{
77 auto const searchPath =
78 {
79 fs::current_path() / "deps",
80 fs::current_path() / "deps" / "lib",
81 fs::current_path() / ".." / "deps",
82 fs::current_path() / ".." / "deps" / "lib",
83 fs::current_path() / ".." / ".." / "deps",
84 fs::current_path() / ".." / ".." / "deps" / "lib",
85 fs::current_path(),
86#ifdef __APPLE__
87 fs::current_path().root_path() / fs::path("usr") / "local" / "lib",
88#endif
89 };
90 for (auto const& basePath: searchPath)
91 {
92 fs::path p = basePath / lib_name;
93 if (fs::exists(p))
94 return p;
95 }
96 return std::nullopt;
97}
98
99}
100

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected