Skip to content
Closed
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
10 changes: 6 additions & 4 deletions toolsrc/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ IncludeCategories:
Priority: -1
- Regex: '^<catch2/catch\.hpp>$'
Priority: 1
- Regex: '^<vcpkg/base/.*\.h>$'
- Regex: '^<vcpkg/fwd/.*\.h>$'
Priority: 2
- Regex: '^<vcpkg/.*\.h>$'
- Regex: '^<vcpkg/base/.*\.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
4 changes: 2 additions & 2 deletions toolsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ if(CLANG_FORMAT)
add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose
${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp
${VCPKGLIB_BASE_SOURCES}
${VCPKGLIB_NON_PCH_SOURCES}
${VCPKGLIB_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h
${VCPKGLIB_BASE_INCLUDES}
${VCPKGLIB_NON_PCH_INCLUDES}
${VCPKGLIB_INCLUDES}

${VCPKG_SOURCES}
${VCPKGMETRICSUPLOADER_SOURCES}
Expand Down
2 changes: 1 addition & 1 deletion toolsrc/include/vcpkg-test/mockcmakevarprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 2 additions & 5 deletions toolsrc/include/vcpkg/archives.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#pragma once

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

namespace vcpkg
{
struct VcpkgPaths;
}
#include <vcpkg/base/files.h>

namespace vcpkg::Archives
{
Expand Down
11 changes: 0 additions & 11 deletions toolsrc/include/vcpkg/base/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions toolsrc/include/vcpkg/buildenvironment.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

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

#include <string>
#include <vector>

namespace vcpkg
{
struct VcpkgPaths;

std::string make_cmake_cmd(const VcpkgPaths& paths,
const fs::path& cmake_script,
std::vector<System::CMakeVariable>&& pass_variables);
Expand Down
7 changes: 2 additions & 5 deletions toolsrc/include/vcpkg/cmakevars.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/optional.h>

#include <vcpkg/portfileprovider.h>
Expand All @@ -9,11 +11,6 @@ namespace vcpkg::Dependencies
struct ActionPlan;
}

namespace vcpkg
{
struct VcpkgPaths;
}

namespace vcpkg::CMakeVars
{
struct CMakeVarProvider
Expand Down
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/commands.contact.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

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

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

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

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

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

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

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

namespace vcpkg::Commands::Edit
{
Expand Down
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/commands.format-manifest.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

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

namespace vcpkg::Commands::FormatManifest
{
Expand Down
5 changes: 1 addition & 4 deletions toolsrc/include/vcpkg/commands.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#pragma once

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

namespace vcpkg::Commands
{
struct BasicCommand;
struct PathsCommand;
struct TripletCommand;

template<class T>
struct PackageNameAndFunction
{
Expand Down
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/commands.info.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

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

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

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

namespace vcpkg::Commands::Integrate
{
Expand Down
15 changes: 5 additions & 10 deletions toolsrc/include/vcpkg/commands.interface.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#pragma once

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

namespace vcpkg
{
struct VcpkgCmdArguments;
struct VcpkgPaths;
namespace Files
{
struct Filesystem;
}
}
#include <vcpkg/base/files.h>

#include <vcpkg/triplet.h>

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

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

namespace vcpkg::Commands::List
{
Expand Down
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/commands.setinstalled.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <vcpkg/cmakevars.h>
#include <vcpkg/commands.interface.h>
#include <vcpkg/portfileprovider.h>
#include <vcpkg/vcpkgcmdarguments.h>

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

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

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

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

namespace vcpkg::Commands::X_VSInstances
{
Expand Down
7 changes: 2 additions & 5 deletions toolsrc/include/vcpkg/export.ifw.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/dependencies.h>

#include <string>
#include <vector>

namespace vcpkg
{
struct VcpkgPaths;
}

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

namespace vcpkg
{
struct Registry;
}
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;
}
1 change: 0 additions & 1 deletion toolsrc/include/vcpkg/help.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

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

#include <string>

Expand Down
32 changes: 32 additions & 0 deletions toolsrc/include/vcpkg/registries.h
Original file line number Diff line number Diff line change
@@ -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;
};

}
4 changes: 3 additions & 1 deletion toolsrc/include/vcpkg/statusparagraph.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/binaryparagraph.h>

#include <map>
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
@@ -1,14 +1,14 @@
#pragma once

#include <vcpkg/fwd/vcpkgpaths.h>

#include <vcpkg/base/files.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
@@ -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>
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
@@ -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>
Expand Down
4 changes: 2 additions & 2 deletions toolsrc/src/vcpkg-test/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ namespace vcpkg::Test
ec.assign(errno, std::system_category());
}
#else
Util::unused(target, file, ec);
(void)(target, file, ec);
vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message);
#endif
}
Expand All @@ -217,7 +217,7 @@ namespace vcpkg::Test
#elif FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_UNIX
::vcpkg::Test::create_symlink(target, file, ec);
#else
Util::unused(target, file, ec);
(void)(target, file, ec);
vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, no_filesystem_message);
#endif
}
Expand Down
Loading