diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-05-22 03:37:40 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-05-22 03:37:40 -0700 |
| commit | 78e4d07e84afc0f1ab23179534aa08bf6e194b98 (patch) | |
| tree | e751b7efacdedce70722aad59311fd06ef91a598 /toolsrc/include | |
| parent | c10d9d117ab452f6842949d26468fd2dab7692cd (diff) | |
| download | vcpkg-78e4d07e84afc0f1ab23179534aa08bf6e194b98.tar.gz vcpkg-78e4d07e84afc0f1ab23179534aa08bf6e194b98.zip | |
[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.
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/stringliteral.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/strings.h | 2 |
2 files changed, 4 insertions, 1 deletions
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<int N> - 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 <vcpkg/base/cstringview.h> +#include <vcpkg/base/stringliteral.h> #include <vector> @@ -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<class Container, class Transformer> std::string join(const char* delimiter, const Container& v, Transformer transformer) |
