From f6530368eb31734734c0e1e7ce990c0cb93f0b24 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 00:19:27 -0700 Subject: Remove noexcept from BinaryParagraph() --- toolsrc/include/vcpkg/binaryparagraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/binaryparagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h index 5ba2fbde3..3315151c6 100644 --- a/toolsrc/include/vcpkg/binaryparagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -12,7 +12,7 @@ namespace vcpkg /// struct BinaryParagraph { - BinaryParagraph() noexcept; + BinaryParagraph(); explicit BinaryParagraph(std::unordered_map fields); BinaryParagraph(const SourceParagraph& spgh, const Triplet& triplet, const std::string& abi_tag); BinaryParagraph(const SourceParagraph& spgh, const FeatureParagraph& fpgh, const Triplet& triplet); -- cgit v1.2.3 From 9167511656715c81d01cc87af5db1835f026f5b6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 18:14:24 -0700 Subject: Fix #3170 issue with /permissive- --- toolsrc/include/tests.utils.h | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/tests.utils.h b/toolsrc/include/tests.utils.h index 970506663..7f7ec9e88 100644 --- a/toolsrc/include/tests.utils.h +++ b/toolsrc/include/tests.utils.h @@ -12,10 +12,42 @@ namespace Microsoft::VisualStudio::CppUnitTestFramework { - std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t); - std::wstring ToString(const vcpkg::Dependencies::RequestType& t); - std::wstring ToString(const vcpkg::PackageSpecParseResult& t); - std::wstring ToString(const vcpkg::PackageSpec& t); + template<> + std::wstring ToString(const vcpkg::Dependencies::InstallPlanType& t) + { + switch (t) + { + case vcpkg::Dependencies::InstallPlanType::ALREADY_INSTALLED: return L"ALREADY_INSTALLED"; + case vcpkg::Dependencies::InstallPlanType::BUILD_AND_INSTALL: return L"BUILD_AND_INSTALL"; + case vcpkg::Dependencies::InstallPlanType::EXCLUDED: return L"EXCLUDED"; + case vcpkg::Dependencies::InstallPlanType::UNKNOWN: return L"UNKNOWN"; + default: return ToString(static_cast(t)); + } + } + + template<> + std::wstring ToString(const vcpkg::Dependencies::RequestType& t) + { + switch (t) + { + case vcpkg::Dependencies::RequestType::AUTO_SELECTED: return L"AUTO_SELECTED"; + case vcpkg::Dependencies::RequestType::USER_REQUESTED: return L"USER_REQUESTED"; + case vcpkg::Dependencies::RequestType::UNKNOWN: return L"UNKNOWN"; + default: return ToString(static_cast(t)); + } + } + + template<> + std::wstring ToString(const vcpkg::PackageSpecParseResult& t) + { + return ToString(static_cast(t)); + } + + template<> + std::wstring ToString(const vcpkg::PackageSpec& t) + { + return ToString(t.to_string()); + } } std::unique_ptr make_status_pgh(const char* name, -- cgit v1.2.3 From a9d989ec056246ea320a56ca7d02b161a6fee387 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 28 Apr 2018 11:26:57 -0700 Subject: [vcpkg-integrate-install] Add vcpkg.path.txt to localappdata for more generic consumption. --- toolsrc/include/vcpkg/userconfig.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/userconfig.h b/toolsrc/include/vcpkg/userconfig.h index 63b8e5481..d044f43ef 100644 --- a/toolsrc/include/vcpkg/userconfig.h +++ b/toolsrc/include/vcpkg/userconfig.h @@ -17,4 +17,6 @@ namespace vcpkg void try_write_data(Files::Filesystem& fs) const; }; + + fs::path get_user_dir(); } -- cgit v1.2.3 From 8f0ebdf8d561ef8402db44cd9abb2c912cff276d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 3 May 2018 15:03:35 -0700 Subject: [vcpkg] Remove utf16 usage from non-Windows --- toolsrc/include/vcpkg/base/strings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 4cc17bcf4..e165c69da 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -34,9 +34,11 @@ namespace vcpkg::Strings return details::format_internal(fmtstr, to_printf_arg(to_printf_arg(args))...); } +#if defined(_WIN32) std::wstring to_utf16(const CStringView& s); std::string to_utf8(const wchar_t* w); +#endif std::string escape_string(const CStringView& s, char char_to_escape, char escape_char); -- cgit v1.2.3 From 1b0682a39e1143660c3d5aa371f66591a64e8a5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 5 May 2018 04:23:19 -0700 Subject: [vcpkg] Significantly reduce usage of powershell. Reduce console font switching bug --- toolsrc/include/vcpkg/base/system.h | 2 ++ toolsrc/include/vcpkg/commands.h | 4 ++-- toolsrc/include/vcpkg/vcpkgpaths.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 0d089276f..cf9c78868 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -47,6 +47,7 @@ namespace vcpkg::System ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line); +#if defined(_WIN32) void powershell_execute(const std::string& title, const fs::path& script_path, const std::vector& parameters = {}); @@ -54,6 +55,7 @@ namespace vcpkg::System std::string powershell_execute_and_capture_output(const std::string& title, const fs::path& script_path, const std::vector& parameters = {}); +#endif enum class Color { diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 6d29b7960..708151dce 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -132,14 +132,14 @@ namespace vcpkg::Commands namespace Hash { std::string get_string_hash(const std::string& s, const std::string& hash_type); - std::string get_file_hash(const VcpkgPaths& paths, const fs::path& path, const std::string& hash_type); + std::string get_file_hash(const Files::Filesystem& fs, const fs::path& path, const std::string& hash_type); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Fetch { - std::vector find_toolset_instances(const VcpkgPaths& paths); + std::vector find_toolset_instances_prefered_first(const VcpkgPaths& paths); fs::path get_tool_path(const VcpkgPaths& paths, const std::string& tool); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 9c8f2911a..a3c90fd33 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -66,6 +66,7 @@ namespace vcpkg fs::path triplets; fs::path scripts; + fs::path tools; fs::path buildsystems; fs::path buildsystems_msbuild_targets; -- cgit v1.2.3 From f69cce7051e4404e19fe8c049c23c4678fe8b3d4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 May 2018 15:30:26 -0700 Subject: Fix typo --- toolsrc/include/vcpkg/commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 708151dce..21e77aa52 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -139,7 +139,7 @@ namespace vcpkg::Commands namespace Fetch { - std::vector find_toolset_instances_prefered_first(const VcpkgPaths& paths); + std::vector find_toolset_instances_preferred_first(const VcpkgPaths& paths); fs::path get_tool_path(const VcpkgPaths& paths, const std::string& tool); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } -- cgit v1.2.3 From 285c69b0faa220311f3ccc60febaa2e7c6d87bb1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 19:01:10 -0700 Subject: [c++] Condense powershell helper code into the remaining single usage `vcpkg integrate powershell` uses it --- toolsrc/include/vcpkg/base/system.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index cf9c78868..813d600cd 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -25,15 +25,6 @@ namespace vcpkg::System 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; @@ -47,16 +38,6 @@ namespace vcpkg::System ExitCodeAndOutput cmd_execute_and_capture_output(const CStringView cmd_line); -#if defined(_WIN32) - void powershell_execute(const std::string& title, - const fs::path& script_path, - const std::vector& parameters = {}); - - std::string powershell_execute_and_capture_output(const std::string& title, - const fs::path& script_path, - const std::vector& parameters = {}); -#endif - enum class Color { success = 10, -- cgit v1.2.3 From 78e4d07e84afc0f1ab23179534aa08bf6e194b98 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 22 May 2018 03:37:40 -0700 Subject: [vcpkg] Improve CMake messages to account for case-sensitive filesystems. Improve CMake messages to display shortest targets first (which are hopefully the "public" ones). Also, fix bug in StringLiteral. --- toolsrc/include/vcpkg/base/stringliteral.h | 3 ++- toolsrc/include/vcpkg/base/strings.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/stringliteral.h b/toolsrc/include/vcpkg/base/stringliteral.h index c07f04cec..9970adc2a 100644 --- a/toolsrc/include/vcpkg/base/stringliteral.h +++ b/toolsrc/include/vcpkg/base/stringliteral.h @@ -7,7 +7,8 @@ namespace vcpkg struct StringLiteral { template - constexpr StringLiteral(const char (&str)[N]) : m_size(N), m_cstr(str) + constexpr StringLiteral(const char (&str)[N]) + : m_size(N - 1) /* -1 here accounts for the null byte at the end*/, m_cstr(str) { } diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index e165c69da..4b39b0a28 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include @@ -53,6 +54,7 @@ namespace vcpkg::Strings std::string ascii_to_uppercase(std::string s); bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern); + bool ends_with(const std::string& s, StringLiteral pattern); template std::string join(const char* delimiter, const Container& v, Transformer transformer) -- cgit v1.2.3