93 lines
2.7 KiB
C
Raw Normal View History

2016-09-18 20:50:08 -07:00
#pragma once
#include <vcpkg/binaryparagraph.h>
#include <vcpkg/packagespec.h>
#include <vcpkg/base/expected.h>
#include <vcpkg/base/files.h>
#include <vcpkg/base/lazy.h>
2016-09-18 20:50:08 -07:00
namespace vcpkg
{
struct ToolsetArchOption
{
CStringView name;
System::CPUArchitecture host_arch;
System::CPUArchitecture target_arch;
};
2017-04-03 16:28:18 -07:00
struct Toolset
{
fs::path visual_studio_root_path;
fs::path dumpbin;
fs::path vcvarsall;
std::vector<std::string> vcvarsall_options;
CStringView version;
std::vector<ToolsetArchOption> supported_architectures;
};
namespace Build
{
struct PreBuildInfo;
}
2017-04-03 16:29:11 -07:00
struct VcpkgPaths
2016-09-18 20:50:08 -07:00
{
2017-04-03 16:29:11 -07:00
static Expected<VcpkgPaths> create(const fs::path& vcpkg_root_dir);
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;
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;
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;
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
fs::path buildsystems;
fs::path buildsystems_msbuild_targets;
2016-09-18 20:50:08 -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
fs::path ports_cmake;
const fs::path& get_cmake_exe() const;
const fs::path& get_git_exe() const;
const fs::path& get_nuget_exe() const;
const fs::path& get_ifw_installerbase_exe() const;
const fs::path& get_ifw_binarycreator_exe() const;
const fs::path& get_ifw_repogen_exe() const;
/// <summary>Retrieve a toolset matching a VS version</summary>
/// <remarks>
/// Valid version strings are "v120", "v140", "v141", and "". Empty string gets the latest.
/// </remarks>
const Toolset& get_toolset(const Build::PreBuildInfo& prebuildinfo) const;
Files::Filesystem& get_filesystem() const;
private:
Lazy<std::vector<std::string>> available_triplets;
2017-04-03 14:23:05 -07:00
Lazy<fs::path> cmake_exe;
Lazy<fs::path> git_exe;
Lazy<fs::path> nuget_exe;
Lazy<fs::path> ifw_installerbase_exe;
Lazy<fs::path> ifw_binarycreator_exe;
Lazy<fs::path> ifw_repogen_exe;
Lazy<std::vector<Toolset>> toolsets;
Lazy<std::vector<Toolset>> toolsets_vs2013;
2016-09-18 20:50:08 -07:00
};
}