aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2020-08-14 09:53:04 -0700
committerGitHub <noreply@github.com>2020-08-14 09:53:04 -0700
commit0c2117845e1f2e3c260b74af8d60f315343b094e (patch)
tree9a0e321a6a30a897803228f1d69d1936b7b3b039 /toolsrc/include
parent2cdf1cad7aa9944a4c8edb90cb3656560c7b56d1 (diff)
downloadvcpkg-0c2117845e1f2e3c260b74af8d60f315343b094e.tar.gz
vcpkg-0c2117845e1f2e3c260b74af8d60f315343b094e.zip
[vcpkg] Reduce dependencies and contents of vcpkgpaths.h (#12876)
* [vcpkg] Remove globally-constructed pre-defined Triplets from vcpkg.exe The tool should be as triplet-agnostic as possible, which leaves little room for special, pre-defined names like this. However, tests do have use of them: moved into test assets. * [vcpkg] Move predefined tools strings vcpkgpaths.h -> tools.h * [vcpkg] Add forward declarations to vcpkgpaths.h to reduce header deps * Merge from origin/master Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg-test/util.h8
-rw-r--r--toolsrc/include/vcpkg/tools.h15
-rw-r--r--toolsrc/include/vcpkg/triplet.h17
-rw-r--r--toolsrc/include/vcpkg/vcpkgpaths.h26
4 files changed, 29 insertions, 37 deletions
diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h
index 5170c846a..d2c512f9b 100644
--- a/toolsrc/include/vcpkg-test/util.h
+++ b/toolsrc/include/vcpkg-test/util.h
@@ -64,6 +64,12 @@ namespace vcpkg::Test
const char* depends = "",
const char* triplet = "x86-windows");
+ extern const Triplet X86_WINDOWS;
+ extern const Triplet X64_WINDOWS;
+ extern const Triplet X86_UWP;
+ extern const Triplet ARM_UWP;
+ extern const Triplet X64_ANDROID;
+
/// <summary>
/// Map of source control files by their package name.
/// </summary>
@@ -71,7 +77,7 @@ namespace vcpkg::Test
{
std::unordered_map<std::string, SourceControlFileLocation> map;
Triplet triplet;
- PackageSpecMap(Triplet t = Triplet::X86_WINDOWS) noexcept : triplet(t) { }
+ PackageSpecMap(Triplet t = X86_WINDOWS) noexcept : triplet(t) { }
PackageSpec emplace(const char* name,
const char* depends = "",
diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h
index b57ca2918..d5c0a5c23 100644
--- a/toolsrc/include/vcpkg/tools.h
+++ b/toolsrc/include/vcpkg/tools.h
@@ -9,6 +9,21 @@ namespace vcpkg
{
struct VcpkgPaths;
+ namespace Tools
+ {
+ static const std::string SEVEN_ZIP = "7zip";
+ static const std::string SEVEN_ZIP_ALT = "7z";
+ static const std::string MAVEN = "mvn";
+ static const std::string CMAKE = "cmake";
+ static const std::string GIT = "git";
+ static const std::string MONO = "mono";
+ 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";
+ }
+
struct ToolCache
{
virtual ~ToolCache() { }
diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h
index 736b22a2d..42d99dc3e 100644
--- a/toolsrc/include/vcpkg/triplet.h
+++ b/toolsrc/include/vcpkg/triplet.h
@@ -3,13 +3,12 @@
#include <vcpkg/base/optional.h>
#include <vcpkg/base/system.h>
-#include <vcpkg/vcpkgcmdarguments.h>
-
#include <string>
namespace vcpkg
{
struct TripletInstance;
+ struct VcpkgCmdArguments;
struct Triplet
{
@@ -18,20 +17,6 @@ namespace vcpkg
static Triplet from_canonical_name(std::string&& triplet_as_string);
- static const Triplet X86_WINDOWS;
- static const Triplet X64_WINDOWS;
- static const Triplet ARM_WINDOWS;
- static const Triplet ARM64_WINDOWS;
- static const Triplet X86_UWP;
- static const Triplet X64_UWP;
- static const Triplet ARM_UWP;
- static const Triplet ARM64_UWP;
-
- static const Triplet ARM_ANDROID;
- static const Triplet ARM64_ANDROID;
- static const Triplet X86_ANDROID;
- static const Triplet X64_ANDROID;
-
const std::string& canonical_name() const;
const std::string& to_string() const;
void to_string(std::string& out) const;
diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h
index 594407c4b..721b59606 100644
--- a/toolsrc/include/vcpkg/vcpkgpaths.h
+++ b/toolsrc/include/vcpkg/vcpkgpaths.h
@@ -4,30 +4,11 @@
#include <vcpkg/base/files.h>
#include <vcpkg/base/lazy.h>
#include <vcpkg/base/optional.h>
+#include <vcpkg/base/system.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/binaryparagraph.h>
-#include <vcpkg/packagespec.h>
-#include <vcpkg/tools.h>
-#include <vcpkg/vcpkgcmdarguments.h>
-
namespace vcpkg
{
- namespace Tools
- {
- static const std::string SEVEN_ZIP = "7zip";
- static const std::string SEVEN_ZIP_ALT = "7z";
- static const std::string MAVEN = "mvn";
- static const std::string CMAKE = "cmake";
- static const std::string GIT = "git";
- static const std::string MONO = "mono";
- 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";
- }
-
struct ToolsetArchOption
{
CStringView name;
@@ -61,6 +42,11 @@ namespace vcpkg
struct VcpkgPathsImpl;
}
+ struct BinaryParagraph;
+ struct VcpkgCmdArguments;
+ struct PackageSpec;
+ struct Triplet;
+
struct VcpkgPaths : Util::MoveOnlyBase
{
struct TripletFile