Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add Forward Declarations (originally by @cngzhnp) #12985

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions toolsrc/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ IncludeCategories:
Priority: 1
- Regex: '^<vcpkg/base/.*\.h>$'
Priority: 2
- Regex: '^<vcpkg/.*\.h>$'
- Regex: '^<vcpkg/fwd/.*\.h>$'
Priority: 3
- Regex: '^<[a-z0-9_]*\.h>$'
- Regex: '^<vcpkg/.*\.h>$'
Priority: 4
- Regex: '^<[a-z0-9_]*>$' # C++ standard library
- Regex: '^<[a-z0-9_]*\.h>$'
Priority: 5
- Regex: '^<[a-z0-9_]*>$' # C++ standard library
Priority: 6
2 changes: 1 addition & 1 deletion toolsrc/include/vcpkg/archives.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <vcpkg/base/files.h>

#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/fwd/vcpkgpaths.h>

namespace vcpkg::Archives
{
Expand Down
4 changes: 3 additions & 1 deletion toolsrc/include/vcpkg/buildenvironment.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once

#include <vcpkg/base/system.process.h>

#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/fwd/vcpkgpaths.h>

#include <string>
#include <vector>
Expand Down
3 changes: 2 additions & 1 deletion toolsrc/include/vcpkg/cmakevars.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

#include <vcpkg/base/optional.h>

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/portfileprovider.h>
#include <vcpkg/vcpkgpaths.h>

namespace vcpkg::Dependencies
{
Expand Down
7 changes: 1 addition & 6 deletions toolsrc/include/vcpkg/commands.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
#pragma once

#include <vcpkg/build.h>
#include <vcpkg/commands.interface.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/statusparagraphs.h>

#include <array>
#include <map>
#include <vector>
#include <vcpkg/build.h>

namespace vcpkg::Commands
{
Expand Down
8 changes: 6 additions & 2 deletions toolsrc/include/vcpkg/commands.interface.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#pragma once

#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/triplet.h>

#include <vcpkg/base/files.h>

#include <vcpkg/fwd/vcpkgpaths.h>
#include <vcpkg/fwd/vcpkgcmdarguments.h>

namespace vcpkg::Commands
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/commands.owns.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <vcpkg/commands.interface.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Owns
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/commands.search.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <vcpkg/commands.interface.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Search
{
Expand Down
19 changes: 15 additions & 4 deletions toolsrc/include/vcpkg/dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion toolsrc/include/vcpkg/export.ifw.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once

#include <vcpkg/dependencies.h>
#include <vcpkg/vcpkgpaths.h>

#include <vcpkg/fwd/vcpkgpaths.h>

#include <string>
#include <vector>
Expand Down
13 changes: 13 additions & 0 deletions toolsrc/include/vcpkg/fwd/vcpkgcmdarguments.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

namespace vcpkg
{
struct ParsedArguments;
struct CommandSwitch;
struct CommandSetting;
struct CommandMultiSetting;
struct CommandOptionsStructure;
struct CommandStructure;
struct HelpTableFormatter;
struct VcpkgCmdArguments;
}
8 changes: 8 additions & 0 deletions toolsrc/include/vcpkg/fwd/vcpkgpaths.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

namespace vcpkg
{
struct ToolsetArchOption;
struct Toolset;
struct VcpkgPaths;
}
4 changes: 3 additions & 1 deletion toolsrc/include/vcpkg/statusparagraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <vcpkg/binaryparagraph.h>

#include <vcpkg/fwd/vcpkgpaths.h>

#include <map>

namespace vcpkg
Expand Down Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions toolsrc/include/vcpkg/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#include <vcpkg/base/files.h>

#include <vcpkg/fwd/vcpkgpaths.h>

#include <string>
#include <utility>

namespace vcpkg
{
struct VcpkgPaths;

namespace Tools
{
static const std::string SEVEN_ZIP = "7zip";
Expand Down
5 changes: 3 additions & 2 deletions toolsrc/include/vcpkg/vcpkgcmdarguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <vcpkg/base/span.h>
#include <vcpkg/base/stringliteral.h>

#include <vcpkg/fwd/vcpkgcmdarguments.h>
#include <vcpkg/fwd/vcpkgpaths.h>

#include <memory>
#include <unordered_map>
#include <unordered_set>
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions toolsrc/include/vcpkg/vcpkgpaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <vcpkg/base/system.h>
#include <vcpkg/base/util.h>

#include <vcpkg/fwd/vcpkgpaths.h>

namespace vcpkg
{
struct ToolsetArchOption
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/archives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <vcpkg/archives.h>
#include <vcpkg/commands.h>
#include <vcpkg/tools.h>
#include <vcpkg/vcpkgpaths.h>

namespace vcpkg::Archives
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/buildenvironment.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <vcpkg/buildenvironment.h>
#include <vcpkg/tools.h>
#include <vcpkg/vcpkgpaths.h>

namespace vcpkg
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.autocomplete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vcpkg/paragraphs.h>
#include <vcpkg/remove.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Autocomplete
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.buildexternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <vcpkg/commands.buildexternal.h>
#include <vcpkg/help.h>
#include <vcpkg/input.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::BuildExternal
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vcpkg/commands.cache.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Cache
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.ci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <vcpkg/packagespec.h>
#include <vcpkg/platform-expression.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/vcpkgcmdarguments.h>

using namespace vcpkg;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/commands.ciclean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <vcpkg/commands.ciclean.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

using namespace vcpkg;

Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/commands.contact.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include <vcpkg/base/chrono.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/system.process.h>
#include <vcpkg/base/util.h>

#include <vcpkg/commands.contact.h>
#include <vcpkg/help.h>
#include <vcpkg/userconfig.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Contact
{
Expand Down
3 changes: 3 additions & 0 deletions toolsrc/src/vcpkg/commands.create.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include <vcpkg/base/checks.h>
#include <vcpkg/base/files.h>
#include <vcpkg/base/util.h>

#include <vcpkg/buildenvironment.h>
#include <vcpkg/commands.create.h>
#include <vcpkg/help.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Create
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.dependinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <vcpkg/input.h>
#include <vcpkg/install.h>
#include <vcpkg/packagespec.h>
#include <vcpkg/vcpkgcmdarguments.h>

#include <vector>

Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vcpkg/commands.edit.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/vcpkgcmdarguments.h>

#include <limits.h>

Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vcpkg/cmakevars.h>
#include <vcpkg/commands.env.h>
#include <vcpkg/help.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Env
{
Expand Down
3 changes: 3 additions & 0 deletions toolsrc/src/vcpkg/commands.fetch.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include <vcpkg/base/system.print.h>

#include <vcpkg/commands.fetch.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Fetch
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.format-manifest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <vcpkg/paragraphs.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/sourceparagraph.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace
{
Expand Down
4 changes: 4 additions & 0 deletions toolsrc/src/vcpkg/commands.hash.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include <vcpkg/base/hash.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/util.h>

#include <vcpkg/commands.hash.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Hash
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <vcpkg/statusparagraphs.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/versiont.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Info
{
Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/commands.integrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <vcpkg/metrics.h>
#include <vcpkg/tools.h>
#include <vcpkg/userconfig.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Integrate
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <vcpkg/help.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/versiont.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::List
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.owns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <vcpkg/commands.owns.h>
#include <vcpkg/help.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Owns
{
Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/commands.porthistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <vcpkg/commands.porthistory.h>
#include <vcpkg/help.h>
#include <vcpkg/tools.h>
#include <vcpkg/vcpkgpaths.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::PortHistory
{
Expand Down
Loading