aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_build_external.cpp
blob: 7b5a010256f18aa69c5224aa7f86b1d131b1d67a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "pch.h"
#include "vcpkg_Commands.h"
#include "vcpkg_System.h"
#include "vcpkg_Input.h"

namespace vcpkg::Commands::BuildExternal
{
    void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
    {
        static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)");
        args.check_exact_arg_count(2, example);
        const PackageSpec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example);
        Input::check_triplet(spec.target_triplet(), paths);
        const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({});

        const fs::path port_dir = args.command_arguments.at(1);
        Build::perform_and_exit(spec, port_dir, options, paths);
    }
}