[vcpkg] Fix build command for packages that depend of features

Signed-off-by: Squareys <squareys@googlemail.com>
This commit is contained in:
Squareys 2018-02-16 14:27:32 +01:00
parent 16faed6785
commit f1ce125a28
2 changed files with 10 additions and 7 deletions

View File

@ -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;
};

View File

@ -267,13 +267,16 @@ namespace vcpkg::Build
const Triplet& triplet = config.triplet;
{
std::vector<PackageSpec> missing_specs;
std::vector<FeatureSpec> missing_specs;
for (auto&& dep : filter_dependencies(config.scf.core_paragraph->depends, triplet))
{
auto dep_spec = PackageSpec::from_name_and_triplet(dep, triplet).value_or_exit(VCPKG_LINE_INFO);
if (!status_db.is_installed(dep_spec))
auto dep_specs = FeatureSpec::from_strings_and_triplet({dep}, triplet);
for (auto&& feature : dep_specs)
{
missing_specs.push_back(std::move(dep_spec));
if (!status_db.is_installed(feature))
{
missing_specs.push_back(std::move(feature));
}
}
}
// Fail the build if any dependencies were missing
@ -600,7 +603,7 @@ namespace vcpkg::Build
: code(code), binary_control_file(std::move(bcf))
{
}
ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::vector<PackageSpec>&& unmet_deps)
ExtendedBuildResult::ExtendedBuildResult(BuildResult code, std::vector<FeatureSpec>&& unmet_deps)
: code(code), unmet_dependencies(std::move(unmet_deps))
{
}