2017-01-28 04:49:09 +08:00
|
|
|
#include "pch.h"
|
2017-04-28 09:08:52 +08:00
|
|
|
|
2017-01-13 09:03:21 +08:00
|
|
|
#include "vcpkg_Commands.h"
|
|
|
|
#include "vcpkg_Input.h"
|
2017-04-28 09:08:52 +08:00
|
|
|
#include "vcpkg_System.h"
|
2017-01-13 09:03:21 +08:00
|
|
|
|
2017-01-13 14:03:57 +08:00
|
|
|
namespace vcpkg::Commands::BuildExternal
|
2017-01-13 09:03:21 +08:00
|
|
|
{
|
2017-04-11 04:00:33 +08:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet)
|
2017-01-13 09:03:21 +08:00
|
|
|
{
|
2017-04-28 09:08:52 +08:00
|
|
|
static const std::string example =
|
|
|
|
Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)");
|
2017-01-13 09:03:21 +08:00
|
|
|
args.check_exact_arg_count(2, example);
|
2017-04-28 09:08:52 +08:00
|
|
|
const PackageSpec spec =
|
|
|
|
Input::check_and_get_package_spec(args.command_arguments.at(0), default_triplet, example);
|
2017-04-11 04:03:34 +08:00
|
|
|
Input::check_triplet(spec.triplet(), paths);
|
2017-02-18 07:09:15 +08:00
|
|
|
const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({});
|
2017-01-13 09:03:21 +08:00
|
|
|
|
2017-02-18 07:09:15 +08:00
|
|
|
const fs::path port_dir = args.command_arguments.at(1);
|
2017-04-30 19:09:05 +08:00
|
|
|
BuildCommand::perform_and_exit(spec, port_dir, options, paths);
|
2017-01-13 09:03:21 +08:00
|
|
|
}
|
|
|
|
}
|