2016-09-18 20:50:08 -07:00
|
|
|
#pragma once
|
2017-10-13 18:37:41 -07:00
|
|
|
|
|
|
|
#include <vcpkg/binaryparagraph.h>
|
|
|
|
#include <vcpkg/packagespec.h>
|
2018-07-09 06:29:37 -07:00
|
|
|
#include <vcpkg/tools.h>
|
2017-10-13 18:37:41 -07:00
|
|
|
|
2018-04-06 14:51:53 -07:00
|
|
|
#include <vcpkg/base/cache.h>
|
2017-10-13 18:37:41 -07:00
|
|
|
#include <vcpkg/base/expected.h>
|
|
|
|
#include <vcpkg/base/files.h>
|
2017-10-16 11:44:04 -07:00
|
|
|
#include <vcpkg/base/lazy.h>
|
2016-09-18 20:50:08 -07:00
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2018-04-04 01:45:45 -07:00
|
|
|
namespace Tools
|
|
|
|
{
|
|
|
|
static const std::string SEVEN_ZIP = "7zip";
|
|
|
|
static const std::string CMAKE = "cmake";
|
|
|
|
static const std::string GIT = "git";
|
|
|
|
static const std::string NINJA = "ninja";
|
|
|
|
static const std::string NUGET = "nuget";
|
|
|
|
static const std::string IFW_INSTALLER_BASE = "ifw_installerbase";
|
|
|
|
static const std::string IFW_BINARYCREATOR = "ifw_binarycreator";
|
|
|
|
static const std::string IFW_REPOGEN = "ifw_repogen";
|
|
|
|
}
|
|
|
|
|
2017-08-24 13:26:42 +03:00
|
|
|
struct ToolsetArchOption
|
|
|
|
{
|
2017-10-16 11:44:04 -07:00
|
|
|
CStringView name;
|
2017-08-24 13:26:42 +03:00
|
|
|
System::CPUArchitecture host_arch;
|
|
|
|
System::CPUArchitecture target_arch;
|
|
|
|
};
|
|
|
|
|
2017-04-03 16:28:18 -07:00
|
|
|
struct Toolset
|
2017-03-31 17:40:08 -07:00
|
|
|
{
|
2017-10-05 13:51:28 -07:00
|
|
|
fs::path visual_studio_root_path;
|
2017-04-01 02:08:48 -07:00
|
|
|
fs::path dumpbin;
|
|
|
|
fs::path vcvarsall;
|
2017-10-16 11:44:04 -07:00
|
|
|
std::vector<std::string> vcvarsall_options;
|
|
|
|
CStringView version;
|
2017-08-24 13:26:42 +03:00
|
|
|
std::vector<ToolsetArchOption> supported_architectures;
|
2017-03-31 17:40:08 -07:00
|
|
|
};
|
|
|
|
|
2017-11-25 11:49:15 -08:00
|
|
|
namespace Build
|
|
|
|
{
|
|
|
|
struct PreBuildInfo;
|
|
|
|
}
|
|
|
|
|
2017-04-03 16:29:11 -07:00
|
|
|
struct VcpkgPaths
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
2018-03-10 14:19:07 -08:00
|
|
|
static Expected<VcpkgPaths> create(const fs::path& vcpkg_root_dir, const std::string& default_vs_path);
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2017-04-03 14:45:00 -07:00
|
|
|
fs::path package_dir(const PackageSpec& spec) const;
|
|
|
|
fs::path port_dir(const PackageSpec& spec) const;
|
2017-08-21 17:16:14 -07:00
|
|
|
fs::path port_dir(const std::string& name) const;
|
2017-04-03 14:45:00 -07:00
|
|
|
fs::path build_info_file_path(const PackageSpec& spec) const;
|
2016-11-07 17:54:23 -08:00
|
|
|
fs::path listfile_path(const BinaryParagraph& pgh) const;
|
2016-11-08 14:12:49 -08:00
|
|
|
|
2017-10-15 23:24:34 -07:00
|
|
|
const std::vector<std::string>& get_available_triplets() const;
|
2017-04-03 15:02:45 -07:00
|
|
|
bool is_valid_triplet(const Triplet& t) const;
|
2016-09-23 14:25:17 -07:00
|
|
|
|
2016-09-30 16:34:55 -07:00
|
|
|
fs::path root;
|
|
|
|
fs::path packages;
|
|
|
|
fs::path buildtrees;
|
|
|
|
fs::path downloads;
|
|
|
|
fs::path ports;
|
|
|
|
fs::path installed;
|
|
|
|
fs::path triplets;
|
2017-01-23 15:12:43 -08:00
|
|
|
fs::path scripts;
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2018-05-05 04:23:19 -07:00
|
|
|
fs::path tools;
|
2016-09-30 16:34:55 -07:00
|
|
|
fs::path buildsystems;
|
|
|
|
fs::path buildsystems_msbuild_targets;
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2016-09-30 16:34:55 -07:00
|
|
|
fs::path vcpkg_dir;
|
|
|
|
fs::path vcpkg_dir_status_file;
|
|
|
|
fs::path vcpkg_dir_info;
|
|
|
|
fs::path vcpkg_dir_updates;
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2016-09-30 16:34:55 -07:00
|
|
|
fs::path ports_cmake;
|
2017-03-10 16:30:44 -08:00
|
|
|
|
2018-04-04 01:45:45 -07:00
|
|
|
const fs::path& get_tool_exe(const std::string& tool) const;
|
2018-07-09 06:29:37 -07:00
|
|
|
const std::string& get_tool_version(const std::string& tool) const;
|
2017-06-02 18:13:12 +02:00
|
|
|
|
2017-06-05 22:01:41 -07:00
|
|
|
/// <summary>Retrieve a toolset matching a VS version</summary>
|
|
|
|
/// <remarks>
|
2017-09-02 16:48:29 +02:00
|
|
|
/// Valid version strings are "v120", "v140", "v141", and "". Empty string gets the latest.
|
2017-06-05 22:01:41 -07:00
|
|
|
/// </remarks>
|
2017-11-25 11:49:15 -08:00
|
|
|
const Toolset& get_toolset(const Build::PreBuildInfo& prebuildinfo) const;
|
2017-03-10 16:30:44 -08:00
|
|
|
|
2017-04-08 16:26:26 -07:00
|
|
|
Files::Filesystem& get_filesystem() const;
|
|
|
|
|
2017-03-10 16:30:44 -08:00
|
|
|
private:
|
2017-10-15 23:24:34 -07:00
|
|
|
Lazy<std::vector<std::string>> available_triplets;
|
2017-06-02 18:13:12 +02:00
|
|
|
Lazy<std::vector<Toolset>> toolsets;
|
2017-10-03 16:00:23 -07:00
|
|
|
Lazy<std::vector<Toolset>> toolsets_vs2013;
|
2018-03-10 14:19:07 -08:00
|
|
|
|
|
|
|
fs::path default_vs_path;
|
2018-07-09 06:29:37 -07:00
|
|
|
|
|
|
|
mutable std::unique_ptr<ToolCache> m_tool_cache;
|
2016-09-18 20:50:08 -07:00
|
|
|
};
|
|
|
|
}
|