From a26c88c754c14e2fd059f2ddbd69802b875b77ea Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Sep 2016 23:53:13 -0700 Subject: `vcpkg build` will now show helpful error if dependencies are missing --- toolsrc/src/commands_installation.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'toolsrc/src/commands_installation.cpp') 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 specs = args.parse_all_arguments_as_package_specs(default_target_triplet); + std::unordered_set 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) { -- cgit v1.2.3