aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-08-19 15:33:15 -0700
committerGitHub <noreply@github.com>2020-08-19 15:33:15 -0700
commit5e164e3dd2b9fbbd68782f4c3c73242918b3c688 (patch)
treefcb68cc8feb0173b7f1e0b29a265281f7c9ea90f /toolsrc/include
parent2b55727614f48024dfc52dce0ff93a5748d640cc (diff)
downloadvcpkg-5e164e3dd2b9fbbd68782f4c3c73242918b3c688.tar.gz
vcpkg-5e164e3dd2b9fbbd68782f4c3c73242918b3c688.zip
[vcpkg] Add Forward Declarations (originally by @cngzhnp) (#12985)
Co-authored-by: cngzhnp <cengizhanpasaoglu@gmail.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg-test/mockcmakevarprovider.h2
-rw-r--r--toolsrc/include/vcpkg/archives.h4
-rw-r--r--toolsrc/include/vcpkg/base/util.h11
-rw-r--r--toolsrc/include/vcpkg/buildenvironment.h6
-rw-r--r--toolsrc/include/vcpkg/cmakevars.h3
-rw-r--r--toolsrc/include/vcpkg/commands.h6
-rw-r--r--toolsrc/include/vcpkg/commands.interface.h8
-rw-r--r--toolsrc/include/vcpkg/commands.owns.h1
-rw-r--r--toolsrc/include/vcpkg/commands.search.h1
-rw-r--r--toolsrc/include/vcpkg/dependencies.h19
-rw-r--r--toolsrc/include/vcpkg/export.ifw.h3
-rw-r--r--toolsrc/include/vcpkg/fwd/registries.h6
-rw-r--r--toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h13
-rw-r--r--toolsrc/include/vcpkg/fwd/vcpkgpaths.h8
-rw-r--r--toolsrc/include/vcpkg/registries.h32
-rw-r--r--toolsrc/include/vcpkg/statusparagraph.h4
-rw-r--r--toolsrc/include/vcpkg/tools.h4
-rw-r--r--toolsrc/include/vcpkg/vcpkgcmdarguments.h5
-rw-r--r--toolsrc/include/vcpkg/vcpkgpaths.h2
19 files changed, 103 insertions, 35 deletions
diff --git a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h
index 482f9ea40..15b24b8d0 100644
--- a/toolsrc/include/vcpkg-test/mockcmakevarprovider.h
+++ b/toolsrc/include/vcpkg-test/mockcmakevarprovider.h
@@ -19,7 +19,7 @@ namespace vcpkg::Test
{
for (auto&& spec : specs)
tag_vars[spec.package_spec] = {};
- Util::unused(port_provider);
+ (void)(port_provider);
}
Optional<const std::unordered_map<std::string, std::string>&> get_generic_triplet_vars(
diff --git a/toolsrc/include/vcpkg/archives.h b/toolsrc/include/vcpkg/archives.h
index 073217064..be2523dfb 100644
--- a/toolsrc/include/vcpkg/archives.h
+++ b/toolsrc/include/vcpkg/archives.h
@@ -1,8 +1,8 @@
#pragma once
-#include <vcpkg/base/files.h>
+#include <vcpkg/fwd/vcpkgpaths.h>
-#include <vcpkg/vcpkgpaths.h>
+#include <vcpkg/base/files.h>
namespace vcpkg::Archives
{
diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h
index a6d8781b0..11807b249 100644
--- a/toolsrc/include/vcpkg/base/util.h
+++ b/toolsrc/include/vcpkg/base/util.h
@@ -239,15 +239,4 @@ namespace vcpkg::Util
return e == E::YES;
}
}
-
- template<class... Ts>
- void unused(const Ts&...)
- {
- }
-
- template<class T>
- T copy(const T& t)
- {
- return t;
- }
}
diff --git a/toolsrc/include/vcpkg/buildenvironment.h b/toolsrc/include/vcpkg/buildenvironment.h
index 1216caa2a..aa69708b6 100644
--- a/toolsrc/include/vcpkg/buildenvironment.h
+++ b/toolsrc/include/vcpkg/buildenvironment.h
@@ -1,6 +1,8 @@
-#include <vcpkg/base/system.process.h>
+#pragma once
+
+#include <vcpkg/fwd/vcpkgpaths.h>
-#include <vcpkg/vcpkgpaths.h>
+#include <vcpkg/base/system.process.h>
#include <string>
#include <vector>
diff --git a/toolsrc/include/vcpkg/cmakevars.h b/toolsrc/include/vcpkg/cmakevars.h
index 1c02376b9..66dd287b8 100644
--- a/toolsrc/include/vcpkg/cmakevars.h
+++ b/toolsrc/include/vcpkg/cmakevars.h
@@ -1,9 +1,10 @@
#pragma once
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/base/optional.h>
#include <vcpkg/portfileprovider.h>
-#include <vcpkg/vcpkgpaths.h>
namespace vcpkg::Dependencies
{
diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h
index 948d4b5e8..77e478219 100644
--- a/toolsrc/include/vcpkg/commands.h
+++ b/toolsrc/include/vcpkg/commands.h
@@ -2,12 +2,6 @@
#include <vcpkg/build.h>
#include <vcpkg/commands.interface.h>
-#include <vcpkg/dependencies.h>
-#include <vcpkg/statusparagraphs.h>
-
-#include <array>
-#include <map>
-#include <vector>
namespace vcpkg::Commands
{
diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h
index 10d213522..c8bc14ca9 100644
--- a/toolsrc/include/vcpkg/commands.interface.h
+++ b/toolsrc/include/vcpkg/commands.interface.h
@@ -1,7 +1,11 @@
#pragma once
-#include <vcpkg/vcpkgcmdarguments.h>
-#include <vcpkg/vcpkgpaths.h>
+#include <vcpkg/fwd/vcpkgcmdarguments.h>
+#include <vcpkg/fwd/vcpkgpaths.h>
+
+#include <vcpkg/base/files.h>
+
+#include <vcpkg/triplet.h>
namespace vcpkg::Commands
{
diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h
index 13676b2bd..39037649d 100644
--- a/toolsrc/include/vcpkg/commands.owns.h
+++ b/toolsrc/include/vcpkg/commands.owns.h
@@ -1,6 +1,7 @@
#pragma once
#include <vcpkg/commands.interface.h>
+#include <vcpkg/vcpkgcmdarguments.h>
namespace vcpkg::Commands::Owns
{
diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h
index 6220a8866..530a3ac28 100644
--- a/toolsrc/include/vcpkg/commands.search.h
+++ b/toolsrc/include/vcpkg/commands.search.h
@@ -1,6 +1,7 @@
#pragma once
#include <vcpkg/commands.interface.h>
+#include <vcpkg/vcpkgcmdarguments.h>
namespace vcpkg::Commands::Search
{
diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h
index 76ff89e7a..3cca364e7 100644
--- a/toolsrc/include/vcpkg/dependencies.h
+++ b/toolsrc/include/vcpkg/dependencies.h
@@ -4,11 +4,7 @@
#include <vcpkg/base/util.h>
#include <vcpkg/build.h>
-#include <vcpkg/cmakevars.h>
#include <vcpkg/packagespec.h>
-#include <vcpkg/portfileprovider.h>
-#include <vcpkg/statusparagraphs.h>
-#include <vcpkg/vcpkgpaths.h>
#include <functional>
#include <map>
@@ -19,6 +15,21 @@ namespace vcpkg::Graphs
struct Randomizer;
}
+namespace vcpkg::CMakeVars
+{
+ struct CMakeVarProvider;
+}
+
+namespace vcpkg::PortFileProvider
+{
+ struct PortFileProvider;
+}
+
+namespace vcpkg
+{
+ struct StatusParagraphs;
+}
+
namespace vcpkg::Dependencies
{
enum class RequestType
diff --git a/toolsrc/include/vcpkg/export.ifw.h b/toolsrc/include/vcpkg/export.ifw.h
index b1573924e..0fe07227c 100644
--- a/toolsrc/include/vcpkg/export.ifw.h
+++ b/toolsrc/include/vcpkg/export.ifw.h
@@ -1,7 +1,8 @@
#pragma once
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/dependencies.h>
-#include <vcpkg/vcpkgpaths.h>
#include <string>
#include <vector>
diff --git a/toolsrc/include/vcpkg/fwd/registries.h b/toolsrc/include/vcpkg/fwd/registries.h
new file mode 100644
index 000000000..1091a81ad
--- /dev/null
+++ b/toolsrc/include/vcpkg/fwd/registries.h
@@ -0,0 +1,6 @@
+#pragma once
+
+namespace vcpkg
+{
+ struct Registry;
+}
diff --git a/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h
new file mode 100644
index 000000000..87d6f9eaa
--- /dev/null
+++ b/toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h
@@ -0,0 +1,13 @@
+#pragma once
+
+namespace vcpkg
+{
+ struct ParsedArguments;
+ struct CommandSwitch;
+ struct CommandSetting;
+ struct CommandMultiSetting;
+ struct CommandOptionsStructure;
+ struct CommandStructure;
+ struct HelpTableFormatter;
+ struct VcpkgCmdArguments;
+}
diff --git a/toolsrc/include/vcpkg/fwd/vcpkgpaths.h b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h
new file mode 100644
index 000000000..79655bf4a
--- /dev/null
+++ b/toolsrc/include/vcpkg/fwd/vcpkgpaths.h
@@ -0,0 +1,8 @@
+#pragma once
+
+namespace vcpkg
+{
+ struct ToolsetArchOption;
+ struct Toolset;
+ struct VcpkgPaths;
+}
diff --git a/toolsrc/include/vcpkg/registries.h b/toolsrc/include/vcpkg/registries.h
new file mode 100644
index 000000000..17ea56119
--- /dev/null
+++ b/toolsrc/include/vcpkg/registries.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <vcpkg/base/files.h>
+#include <vcpkg/base/optional.h>
+#include <vcpkg/base/
+
+#include <vcpkg/fwd/registries.h>
+
+#include <memory>
+#include <string>
+#include <system_error>
+#include <vector>
+
+namespace vcpkg
+{
+ struct RegistryImpl
+ {
+ virtual void update(std::error_code&) = 0;
+ virtual Optional<fs::path> find_port(StringView name) const = 0;
+
+ virtual ~RegistryImpl() = default;
+ };
+
+ struct Registry
+ {
+ std::string name;
+ std::vector<std::string> packages;
+
+ std::unique_ptr<RegistryImpl> underlying;
+ };
+
+}
diff --git a/toolsrc/include/vcpkg/statusparagraph.h b/toolsrc/include/vcpkg/statusparagraph.h
index cf4c3c046..1cfa7a17c 100644
--- a/toolsrc/include/vcpkg/statusparagraph.h
+++ b/toolsrc/include/vcpkg/statusparagraph.h
@@ -1,5 +1,7 @@
#pragma once
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/binaryparagraph.h>
#include <map>
@@ -62,5 +64,5 @@ namespace vcpkg
std::vector<const StatusParagraph*> features;
};
- Json::Value serialize_ipv(const InstalledPackageView& ipv, const struct VcpkgPaths& paths);
+ Json::Value serialize_ipv(const InstalledPackageView& ipv, const VcpkgPaths& paths);
}
diff --git a/toolsrc/include/vcpkg/tools.h b/toolsrc/include/vcpkg/tools.h
index d5c0a5c23..f9618a52d 100644
--- a/toolsrc/include/vcpkg/tools.h
+++ b/toolsrc/include/vcpkg/tools.h
@@ -1,5 +1,7 @@
#pragma once
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/base/files.h>
#include <string>
@@ -7,8 +9,6 @@
namespace vcpkg
{
- struct VcpkgPaths;
-
namespace Tools
{
static const std::string SEVEN_ZIP = "7zip";
diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h
index 84cd7c599..3e956c83e 100644
--- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h
+++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h
@@ -1,5 +1,8 @@
#pragma once
+#include <vcpkg/fwd/vcpkgcmdarguments.h>
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/base/files.h>
#include <vcpkg/base/optional.h>
#include <vcpkg/base/span.h>
@@ -19,8 +22,6 @@ namespace vcpkg
std::unordered_map<std::string, std::vector<std::string>> multisettings;
};
- struct VcpkgPaths;
-
struct CommandSwitch
{
constexpr CommandSwitch(const StringLiteral& name, const StringLiteral& short_help_text)
diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h
index 721b59606..2262543d9 100644
--- a/toolsrc/include/vcpkg/vcpkgpaths.h
+++ b/toolsrc/include/vcpkg/vcpkgpaths.h
@@ -1,5 +1,7 @@
#pragma once
+#include <vcpkg/fwd/vcpkgpaths.h>
+
#include <vcpkg/base/cache.h>
#include <vcpkg/base/files.h>
#include <vcpkg/base/lazy.h>