mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 11:37:12 +01:00

This command takes a list of ports, and causes the final state of the installed directory to be as-if one ran the install on an empty installed directory (removing any unnecessary packages). This is especially useful with the new `--x-install-root` option, which allows one to set the `installed` directory for vcpkg to use. Additionally, as a drive-by, we do some `stdfs` clean-up and add a `.is_feature()` member function to BinaryParagraph (as opposed to checking for `.feature().empty()`, which is far less clear to read). This feature is experimental.
174 lines
5.0 KiB
C++
174 lines
5.0 KiB
C++
#pragma once
|
|
|
|
#include <vcpkg/build.h>
|
|
#include <vcpkg/dependencies.h>
|
|
#include <vcpkg/statusparagraphs.h>
|
|
#include <vcpkg/vcpkgcmdarguments.h>
|
|
#include <vcpkg/vcpkgpaths.h>
|
|
|
|
#include <array>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
namespace vcpkg::Commands
|
|
{
|
|
using CommandTypeA = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
using CommandTypeC = void (*)(const VcpkgCmdArguments& args);
|
|
|
|
namespace BuildExternal
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
namespace CI
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
namespace Env
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
namespace Create
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Upgrade
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
namespace Edit
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace DependInfo
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
namespace Search
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace List
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Owns
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Cache
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Import
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Integrate
|
|
{
|
|
extern const char* const INTEGRATE_COMMAND_HELPSTRING;
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace PortsDiff
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace PortHistory
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Autocomplete
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Version
|
|
{
|
|
const char* base_version();
|
|
const std::string& version();
|
|
void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths);
|
|
void perform_and_exit(const VcpkgCmdArguments& args);
|
|
}
|
|
|
|
namespace Contact
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
const std::string& email();
|
|
void perform_and_exit(const VcpkgCmdArguments& args);
|
|
}
|
|
|
|
namespace X_VSInstances
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Hash
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace Fetch
|
|
{
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
|
}
|
|
|
|
namespace SetInstalled
|
|
{
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
|
}
|
|
|
|
template<class T>
|
|
struct PackageNameAndFunction
|
|
{
|
|
std::string name;
|
|
T function;
|
|
};
|
|
|
|
Span<const PackageNameAndFunction<CommandTypeA>> get_available_commands_type_a();
|
|
Span<const PackageNameAndFunction<CommandTypeB>> get_available_commands_type_b();
|
|
Span<const PackageNameAndFunction<CommandTypeC>> get_available_commands_type_c();
|
|
|
|
template<typename T>
|
|
T find(const std::string& command_name, const std::vector<PackageNameAndFunction<T>> available_commands)
|
|
{
|
|
for (const PackageNameAndFunction<T>& cmd : available_commands)
|
|
{
|
|
if (cmd.name == command_name)
|
|
{
|
|
return cmd.function;
|
|
}
|
|
}
|
|
|
|
// not found
|
|
return nullptr;
|
|
}
|
|
}
|