aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2020-11-30 19:07:51 +0100
committerGitHub <noreply@github.com>2020-11-30 10:07:51 -0800
commit3fd77452e0629db5a0f672b646368552a85ccce2 (patch)
treeb8fc9f45d263f59cf94f86c59fa2a91ae8d9404d /toolsrc/include
parent24c67cb37910371b1572ec7afc919d49e329b6a6 (diff)
downloadvcpkg-3fd77452e0629db5a0f672b646368552a85ccce2.tar.gz
vcpkg-3fd77452e0629db5a0f672b646368552a85ccce2.zip
[vcpkg] Add option cmake-args (#12877)
* [vcpkg] Add option cmake-args to pass additional args to the script execution * apply clang format to install.cpp * rename command to x-cmake-args * imply editable if x-cmake-args are not empty. * don't use bitwise or * add a definition for CMAKE_SCRIPT_ARG Co-authored-by: wangli28 <wangli28@beyondsoft.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/base/system.process.h1
-rw-r--r--toolsrc/include/vcpkg/build.h9
-rw-r--r--toolsrc/include/vcpkg/install.h6
-rw-r--r--toolsrc/include/vcpkg/vcpkgcmdarguments.h3
4 files changed, 14 insertions, 5 deletions
diff --git a/toolsrc/include/vcpkg/base/system.process.h b/toolsrc/include/vcpkg/base/system.process.h
index e81bcfed7..3b60630bb 100644
--- a/toolsrc/include/vcpkg/base/system.process.h
+++ b/toolsrc/include/vcpkg/base/system.process.h
@@ -15,6 +15,7 @@ namespace vcpkg::System
CMakeVariable(const StringView varname, const char* varvalue);
CMakeVariable(const StringView varname, const std::string& varvalue);
CMakeVariable(const StringView varname, const fs::path& path);
+ CMakeVariable(std::string var);
std::string s;
};
diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h
index 773d3eeef..2e3c5fafa 100644
--- a/toolsrc/include/vcpkg/build.h
+++ b/toolsrc/include/vcpkg/build.h
@@ -56,13 +56,15 @@ namespace vcpkg::Build
namespace Command
{
- int perform_ex(const FullPackageSpec& full_spec,
+ int perform_ex(const VcpkgCmdArguments& args,
+ const FullPackageSpec& full_spec,
const SourceControlFileLocation& scfl,
const PortFileProvider::PathsPortFileProvider& provider,
IBinaryProvider& binaryprovider,
const IBuildLogsRecorder& build_logs_recorder,
const VcpkgPaths& paths);
- void perform_and_exit_ex(const FullPackageSpec& full_spec,
+ void perform_and_exit_ex(const VcpkgCmdArguments& args,
+ const FullPackageSpec& full_spec,
const SourceControlFileLocation& scfl,
const PortFileProvider::PathsPortFileProvider& provider,
IBinaryProvider& binaryprovider,
@@ -232,7 +234,8 @@ namespace vcpkg::Build
std::unique_ptr<BinaryControlFile> binary_control_file;
};
- ExtendedBuildResult build_package(const VcpkgPaths& paths,
+ ExtendedBuildResult build_package(const VcpkgCmdArguments& args,
+ const VcpkgPaths& paths,
const Dependencies::InstallPlanAction& config,
IBinaryProvider& binaries_provider,
const IBuildLogsRecorder& build_logs_recorder,
diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h
index f85d48d8d..8187735c5 100644
--- a/toolsrc/include/vcpkg/install.h
+++ b/toolsrc/include/vcpkg/install.h
@@ -59,7 +59,8 @@ namespace vcpkg::Install
const fs::path& listfile() const;
};
- Build::ExtendedBuildResult perform_install_plan_action(const VcpkgPaths& paths,
+ Build::ExtendedBuildResult perform_install_plan_action(const VcpkgCmdArguments& args,
+ const VcpkgPaths& paths,
Dependencies::InstallPlanAction& action,
StatusParagraphs& status_db,
const CMakeVars::CMakeVarProvider& var_provider);
@@ -83,7 +84,8 @@ namespace vcpkg::Install
const BinaryControlFile& binary_paragraph,
StatusParagraphs* status_db);
- InstallSummary perform(Dependencies::ActionPlan& action_plan,
+ InstallSummary perform(const VcpkgCmdArguments& args,
+ Dependencies::ActionPlan& action_plan,
const KeepGoing keep_going,
const VcpkgPaths& paths,
StatusParagraphs& status_db,
diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h
index db0d96316..16e433d63 100644
--- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h
+++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h
@@ -149,6 +149,9 @@ namespace vcpkg
constexpr static StringLiteral BINARY_SOURCES_ARG = "binarysource";
std::vector<std::string> binary_sources;
+ constexpr static StringLiteral CMAKE_SCRIPT_ARG = "x-cmake-args";
+ std::vector<std::string> cmake_args;
+
constexpr static StringLiteral DEBUG_SWITCH = "debug";
Optional<bool> debug = nullopt;
constexpr static StringLiteral SEND_METRICS_SWITCH = "sendmetrics";