summaryrefslogtreecommitdiffstats
path: root/googletest/cmake
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2021-03-20 05:24:27 (GMT)
committerDerek Mauro <dmauro@google.com>2021-03-22 19:18:50 (GMT)
commit1a8ecf1813d022cc7914e04564b92decff6161fc (patch)
tree3ff9941b412d6470e3a37ffc102bd166a4100171 /googletest/cmake
parent3ff1e8b98a3d1d3abc24a5bacb7651c9b32faedd (diff)
downloadgoogletest-1a8ecf1813d022cc7914e04564b92decff6161fc.zip
googletest-1a8ecf1813d022cc7914e04564b92decff6161fc.tar.gz
googletest-1a8ecf1813d022cc7914e04564b92decff6161fc.tar.bz2
Googletest export
Print std::u8string, std::u16string, and std::u32string as string literals Previously, these types were printed as "{ U+123, U+456, U+789 }". However, printed output in that form is difficult to compare against any literals that might be defined in code. Instead, just treat these types like std::string and std::wstring, escaping non-ASCII characters with a hexadecimal escape sequence. The tests have also been updated to cover the new functionality: as a bonus, the tests now also pass with the MSVC toolchain. Internally, the code has been reorganized to primarily operate in terms of char32_t, under the assumption that char32_t will always be at least as big as wchar_t. While that assumption is currently true, perhaps it won't be in the future... PiperOrigin-RevId: 364033132
Diffstat (limited to 'googletest/cmake')
-rw-r--r--googletest/cmake/internal_utils.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index aadbab4..dc2b685 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -81,6 +81,8 @@ macro(config_compiler_and_linker)
# Suppress "unreachable code" warning
# http://stackoverflow.com/questions/3232669 explains the issue.
set(cxx_base_flags "${cxx_base_flags} -wd4702")
+ # Ensure MSVC treats source files as UTF-8 encoded.
+ set(cxx_base_flags "${cxx_base_flags} -utf-8")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(cxx_base_flags "-Wall -Wshadow -Werror -Wconversion")
set(cxx_exception_flags "-fexceptions")