aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-22 23:53:13 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-22 23:53:13 -0700
commita26c88c754c14e2fd059f2ddbd69802b875b77ea (patch)
tree28b7e925ee12dd0b073ba2169fddcaa546e93624 /toolsrc/src
parent33a2969b9c80c602a28e0d53560f39915de933fc (diff)
downloadvcpkg-a26c88c754c14e2fd059f2ddbd69802b875b77ea.tar.gz
vcpkg-a26c88c754c14e2fd059f2ddbd69802b875b77ea.zip
`vcpkg build` will now show helpful error if dependencies are missing
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/commands_installation.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp
index 7004307b3..29233c5d9 100644
--- a/toolsrc/src/commands_installation.cpp
+++ b/toolsrc/src/commands_installation.cpp
@@ -113,7 +113,23 @@ namespace vcpkg
void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet)
{
+ StatusParagraphs status_db = database_load_check(paths);
+
std::vector<package_spec> specs = args.parse_all_arguments_as_package_specs(default_target_triplet);
+ std::unordered_set<package_spec> unmet_dependencies = Dependencies::find_unmet_dependencies(paths, specs, status_db);
+ if (!unmet_dependencies.empty())
+ {
+ System::println(System::color::error, "The build command requires all dependencies to be already installed.");
+ System::println("The following dependencies are missing:");
+ System::println("");
+ for (const package_spec& p : unmet_dependencies)
+ {
+ System::println(" %s", p.name);
+ }
+ System::println("");
+ exit(EXIT_FAILURE);
+ }
+
Environment::ensure_utilities_on_path(paths);
for (const package_spec& spec : specs)
{