[M5+] add resolver::vcpkg_probe
This commit is contained in:
@@ -71,4 +71,22 @@ auto parse_conanfile(std::string_view conanfile_text, const std::string& fallbac
|
||||
// ResolutionNetworkError.
|
||||
auto conan_probe(const std::string& name) -> util::Result<ConanRecipe>;
|
||||
|
||||
// Output of a microsoft/vcpkg port usage-file scrape.
|
||||
struct VcpkgRecipe {
|
||||
std::string find_package; // e.g. "fmt CONFIG REQUIRED"
|
||||
std::vector<std::string> targets; // e.g. ["fmt::fmt"]
|
||||
};
|
||||
|
||||
// Pure: scrape a vcpkg port `usage` file (plain CMake) for the first
|
||||
// find_package(...) arguments and the targets named in the corresponding
|
||||
// target_link_libraries(...) call. Returns ResolutionUnknownPackage when
|
||||
// no find_package directive appears.
|
||||
auto parse_vcpkg_usage(std::string_view usage_text)
|
||||
-> util::Result<VcpkgRecipe>;
|
||||
|
||||
// Fetches https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/<name>/usage
|
||||
// via `curl` and feeds it through parse_vcpkg_usage. 404 →
|
||||
// ResolutionUnknownPackage; transport errors → ResolutionNetworkError.
|
||||
auto vcpkg_probe(const std::string& name) -> util::Result<VcpkgRecipe>;
|
||||
|
||||
} // namespace cargoxx::resolver
|
||||
|
||||
Reference in New Issue
Block a user