diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-02-16 21:32:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-16 21:32:07 -0800 |
| commit | 7ed5eb18ec729b74cfae216653be34420cd19a98 (patch) | |
| tree | f3161a31a224c778b2051963789f54b312e28bd7 /toolsrc/include | |
| parent | 0822a28059badbb18f301b414222e869845087fb (diff) | |
| parent | f1ce125a28c98fd5a87bf509ac965b06c219d8f3 (diff) | |
| download | vcpkg-7ed5eb18ec729b74cfae216653be34420cd19a98.tar.gz vcpkg-7ed5eb18ec729b74cfae216653be34420cd19a98.zip | |
Merge pull request #2817 from Squareys/fix-build-with-feature-deps
* [vcpkg] Add find/find_installed/is_installed for FeatureSpec
Signed-off-by: Squareys <squareys@googlemail.com>
* [vcpkg] Fix build command for packages that depend of features
Signed-off-by: Squareys <squareys@googlemail.com>
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/build.h | 4 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/statusparagraphs.h | 31 |
2 files changed, 33 insertions, 2 deletions
diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index e3f8bf79e..d7c5c8344 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -104,11 +104,11 @@ namespace vcpkg::Build struct ExtendedBuildResult { ExtendedBuildResult(BuildResult code); - ExtendedBuildResult(BuildResult code, std::vector<PackageSpec>&& unmet_deps); + ExtendedBuildResult(BuildResult code, std::vector<FeatureSpec>&& unmet_deps); ExtendedBuildResult(BuildResult code, std::unique_ptr<BinaryControlFile>&& bcf); BuildResult code; - std::vector<PackageSpec> unmet_dependencies; + std::vector<FeatureSpec> unmet_dependencies; std::unique_ptr<BinaryControlFile> binary_control_file; }; diff --git a/toolsrc/include/vcpkg/statusparagraphs.h b/toolsrc/include/vcpkg/statusparagraphs.h index b3eec266a..fa064de7e 100644 --- a/toolsrc/include/vcpkg/statusparagraphs.h +++ b/toolsrc/include/vcpkg/statusparagraphs.h @@ -20,7 +20,21 @@ namespace vcpkg using iterator = container::reverse_iterator; using const_iterator = container::const_reverse_iterator; + /// <summary>Find the StatusParagraph for given spec.</summary> + /// <param name="spec">Package specification to find the status paragraph for</param> + /// <returns>Iterator for found spec</returns> const_iterator find(const PackageSpec& spec) const { return find(spec.name(), spec.triplet()); } + + /// <summary>Find the StatusParagraph for given feature spec.</summary> + /// <param name="spec">Feature specification to find the status paragraph for</param> + /// <returns>Iterator for found spec</returns> + const_iterator find(const FeatureSpec& spec) const { return find(spec.name(), spec.triplet(), spec.feature()); } + + /// <summary>Find a StatusParagraph by name, triplet and feature.</summary> + /// <param name="name">Package name</param> + /// <param name="triplet">Triplet</param> + /// <param name="feature">Feature name</param> + /// <returns>Iterator for found spec</returns> iterator find(const std::string& name, const Triplet& triplet, const std::string& feature = ""); const_iterator find(const std::string& name, const Triplet& triplet, const std::string& feature = "") const; @@ -28,9 +42,26 @@ namespace vcpkg Optional<InstalledPackageView> find_all_installed(const PackageSpec& spec) const; + /// <summary>Find the StatusParagraph for given spec if installed</summary> + /// <param name="spec">Package specification to find the status for</param> + /// <returns>Iterator for found spec</returns> const_iterator find_installed(const PackageSpec& spec) const; + + /// <summary>Find the StatusParagraph for given feature spec if installed</summary> + /// <param name="spec">Feature specification to find the status for</param> + /// <returns>Iterator for found spec</returns> + const_iterator find_installed(const FeatureSpec& spec) const; + + /// <summary>Find the StatusParagraph for given spec and return its install status</summary> + /// <param name="spec">Package specification to check if installed</param> + /// <returns>`true` if installed, `false` if not or not found.</returns> bool is_installed(const PackageSpec& spec) const; + /// <summary>Find the StatusParagraph for given feature spec and return its install status</summary> + /// <param name="spec">Feature specification to check if installed</param> + /// <returns>`true` if installed, `false` if not or not found.</returns> + bool is_installed(const FeatureSpec& spec) const; + iterator insert(std::unique_ptr<StatusParagraph>); friend void serialize(const StatusParagraphs& pgh, std::string& out_str); |
