diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-02-25 10:13:57 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-02-25 10:40:28 -0800 |
| commit | 8b97ae2dc14672ca83a5a7dc8f1d62af99234476 (patch) | |
| tree | 68a40d1832b70b6e241b5b5d6213798f3253d688 /toolsrc/include | |
| parent | 99d30fa105c9f6b8fe70417fc72fcbf9bfb16dfa (diff) | |
| download | vcpkg-8b97ae2dc14672ca83a5a7dc8f1d62af99234476.tar.gz vcpkg-8b97ae2dc14672ca83a5a7dc8f1d62af99234476.zip | |
[vcpkg] Fix "just-in-time" requirements calculation
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/util.h | 9 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/build.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/commands.h | 1 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/dependencies.h | 6 |
4 files changed, 16 insertions, 5 deletions
diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 6c05a3a9e..5e07b240a 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -127,6 +127,15 @@ namespace vcpkg::Util std::sort(begin(cont), end(cont)); } + template<class Range> + void sort_unique_erase(Range& cont) + { + using std::begin; + using std::end; + std::sort(begin(cont), end(cont)); + cont.erase(std::unique(begin(cont), end(cont)), end(cont)); + } + template<class Range1, class Range2> bool all_equal(const Range1& r1, const Range2& r2) { diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 7ef7d6516..f560dbf57 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -12,6 +12,7 @@ #include <array> #include <map> +#include <set> #include <vector> namespace vcpkg::Build @@ -125,7 +126,7 @@ namespace vcpkg::Build const Triplet& triplet, fs::path&& port_dir, const BuildPackageOptions& build_package_options, - const std::unordered_set<std::string>& feature_list) + const std::set<std::string>& feature_list) : scf(src) , triplet(triplet) , port_dir(std::move(port_dir)) @@ -138,7 +139,7 @@ namespace vcpkg::Build const Triplet& triplet; fs::path port_dir; const BuildPackageOptions& build_package_options; - const std::unordered_set<std::string>& feature_list; + const std::set<std::string>& feature_list; }; ExtendedBuildResult build_package(const VcpkgPaths& paths, diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 31c750b38..4027e12f4 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -120,6 +120,7 @@ namespace vcpkg::Commands namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + std::string get_file_hash(fs::path const& cmake_exe_path, fs::path const& path, std::string const& hash_type); } template<class T> diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index de68d06e9..6e02e4efd 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -39,12 +39,12 @@ namespace vcpkg::Dependencies InstallPlanAction(const PackageSpec& spec, InstalledPackageView&& spghs, - const std::unordered_set<std::string>& features, + const std::set<std::string>& features, const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const SourceControlFile& scf, - const std::unordered_set<std::string>& features, + const std::set<std::string>& features, const RequestType& request_type); std::string displayname() const; @@ -57,7 +57,7 @@ namespace vcpkg::Dependencies InstallPlanType plan_type; RequestType request_type; Build::BuildPackageOptions build_options; - std::unordered_set<std::string> feature_list; + std::set<std::string> feature_list; }; enum class RemovePlanType |
