From 1313a418cfe26d29c7b4ec2f871d93a07e884d10 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 20 Nov 2017 18:17:24 -0800 Subject: Introduce PowershellParameter to add '' to parameter values. Also place that and CMakeVariable in System.h --- toolsrc/include/vcpkg/base/system.h | 24 +++++++++++++++++++++++- toolsrc/include/vcpkg/vcpkglib.h | 15 +-------------- 2 files changed, 24 insertions(+), 15 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 9f2d91435..db537db4b 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -10,6 +10,28 @@ namespace vcpkg::System fs::path get_exe_path_of_current_process(); + struct CMakeVariable + { + CMakeVariable(const CStringView varname, const char* varvalue); + CMakeVariable(const CStringView varname, const std::string& varvalue); + CMakeVariable(const CStringView varname, const fs::path& path); + + std::string s; + }; + + std::string make_cmake_cmd(const fs::path& cmake_exe, + const fs::path& cmake_script, + const std::vector& pass_variables); + + struct PowershellParameter + { + PowershellParameter(const CStringView varname, const char* varvalue); + PowershellParameter(const CStringView varname, const std::string& varvalue); + PowershellParameter(const CStringView varname, const fs::path& path); + + std::string s; + }; + struct ExitCodeAndOutput { int exit_code; @@ -24,7 +46,7 @@ namespace vcpkg::System std::string powershell_execute_and_capture_output(const std::string& title, const fs::path& script_path, - const CStringView args = ""); + const std::vector& parameters = {}); enum class Color { diff --git a/toolsrc/include/vcpkg/vcpkglib.h b/toolsrc/include/vcpkg/vcpkglib.h index 9a7fdb861..3c8e676bf 100644 --- a/toolsrc/include/vcpkg/vcpkglib.h +++ b/toolsrc/include/vcpkg/vcpkglib.h @@ -20,18 +20,5 @@ namespace vcpkg std::vector get_installed_files(const VcpkgPaths& paths, const StatusParagraphs& status_db); - struct CMakeVariable - { - CMakeVariable(const CStringView varname, const char* varvalue); - CMakeVariable(const CStringView varname, const std::string& varvalue); - CMakeVariable(const CStringView varname, const fs::path& path); - - std::string s; - }; - - std::string make_cmake_cmd(const fs::path& cmake_exe, - const fs::path& cmake_script, - const std::vector& pass_variables); - - std::string shorten_text(const std::string& desc, size_t length); + std::string shorten_text(const std::string& desc, const size_t length); } // namespace vcpkg -- cgit v1.2.3