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

Fix forward declarations & replace fwd header files #13972

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/base/checks.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include <vcpkg/base/cstringview.h>
#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/strings.h>

namespace vcpkg::Checks
Expand Down
4 changes: 2 additions & 2 deletions toolsrc/include/vcpkg/base/enums.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/fwd/lineinfo.h>

#include <string>
#include <vcpkg/base/cstringview.h>

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

#include <vcpkg/base/checks.h>
#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/stringliteral.h>

#include <system_error>
Expand Down
6 changes: 6 additions & 0 deletions toolsrc/include/vcpkg/base/fwd/lineinfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

namespace vcpkg
{
struct LineInfo;
}
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/base/graphs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <vcpkg/base/checks.h>
#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/system.print.h>

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion toolsrc/include/vcpkg/base/optional.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <vcpkg/base/fwd/lineinfo.h>
#include <vcpkg/base/fwd/optional.h>

#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/pragmas.h>

#include <type_traits>
Expand Down
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/base/system.debug.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <vcpkg/base/chrono.h>
#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/system.print.h>

#include <atomic>
Expand Down
10 changes: 3 additions & 7 deletions toolsrc/include/vcpkg/binarycaching.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#pragma once

#include <vcpkg/fwd/dependencies.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/expected.h>
#include <vcpkg/base/files.h>

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

namespace vcpkg::Dependencies
{
struct InstallPlanAction;
struct ActionPlan;
}

namespace vcpkg
{
Expand Down
9 changes: 5 additions & 4 deletions toolsrc/include/vcpkg/binarycaching.private.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once

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

#include <vcpkg/base/strings.h>

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

namespace vcpkg
{
Expand Down
3 changes: 2 additions & 1 deletion toolsrc/include/vcpkg/cmakevars.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#pragma once

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

#include <vcpkg/base/optional.h>

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

namespace vcpkg::CMakeVars
{
Expand Down
6 changes: 6 additions & 0 deletions toolsrc/include/vcpkg/fwd/packagespec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

namespace vcpkg
{
struct PackageSpec;
}
9 changes: 7 additions & 2 deletions toolsrc/include/vcpkg/paragraphs.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/expected.h>

#include <vcpkg/binaryparagraph.h>
#include <vcpkg/paragraphparser.h>
#include <vcpkg/vcpkgpaths.h>

namespace vckpg::Parse
{
struct ParseControlErrorInfo;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not in vcpkg/fwd/paragraphparser.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escaped my notice, I will add a forward declaration file for this :)


namespace vcpkg::Paragraphs
{
Expand Down
3 changes: 2 additions & 1 deletion toolsrc/include/vcpkg/vcpkglib.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/sortedvector.h>

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

namespace vcpkg
{
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg-test/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <vcpkg/dependencies.h>
#include <vcpkg/paragraphparser.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/sourceparagraph.h>

#include <vcpkg-test/mockcmakevarprovider.h>
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg-test/manifests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <vcpkg/paragraphs.h>
#include <vcpkg/sourceparagraph.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>

#include <vcpkg-test/util.h>

Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg-test/optional.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <catch2/catch.hpp>

#include <vcpkg/base/lineinfo.h>
#include <vcpkg/base/optional.h>
#include <vcpkg/base/util.h>

Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <vcpkg/userconfig.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkglib.h>
#include <vcpkg/vcpkgpaths.h>

#include <cassert>
#include <fstream>
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vcpkg/input.h>
#include <vcpkg/metrics.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/postbuildlint.h>
#include <vcpkg/statusparagraphs.h>
#include <vcpkg/tools.h>
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/cmakevars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <vcpkg/buildenvironment.h>
#include <vcpkg/cmakevars.h>
#include <vcpkg/dependencies.h>
#include <vcpkg/portfileprovider.h>

using namespace vcpkg;
using vcpkg::Optional;
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/portfileprovider.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 @@ -6,6 +6,7 @@
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.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 @@ -17,6 +17,7 @@
#include <vcpkg/packagespec.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/platform-expression.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkglib.h>

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 @@ -9,6 +9,7 @@
#include <vcpkg/input.h>
#include <vcpkg/install.h>
#include <vcpkg/packagespec.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/vcpkgcmdarguments.h>

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

#include <vcpkg/commands.edit.h>
#include <vcpkg/help.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.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/portfileprovider.h>
#include <vcpkg/vcpkgcmdarguments.h>

namespace vcpkg::Commands::Env
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/commands.list.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/util.h>

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

namespace vcpkg::Commands::PortsDiff
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/paragraphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <vcpkg/paragraphparser.h>
#include <vcpkg/paragraphs.h>
#include <vcpkg/registries.h>
#include <vcpkg/vcpkgpaths.h>

using namespace vcpkg::Parse;
using namespace vcpkg;
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/portfileprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <vcpkg/registries.h>
#include <vcpkg/sourceparagraph.h>
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkgpaths.h>

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

namespace vcpkg
{
Expand Down