aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-01-29 22:20:18 -0500
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-02-09 20:16:17 +0000
commit71c589682f7d1dabc08b56ef7a0a28913e44110e (patch)
tree68a342ed537670a3c98a429684489edb290dda98 /CMakeLists.txt
parent10605c0d1e4b408dbd8fcfcae3897581afefb730 (diff)
downloadboringssl-71c589682f7d1dabc08b56ef7a0a28913e44110e.zip
boringssl-71c589682f7d1dabc08b56ef7a0a28913e44110e.tar.gz
boringssl-71c589682f7d1dabc08b56ef7a0a28913e44110e.tar.bz2
Add functions to convert from Span<const uint8> and std::string_view
These can replace the current der::Input-specific string_view methods. I converted many of the uses within the library, but we should take a pass over the library and turn many of the std::strings into std::vector<uint8_t>. On MSVC, we have to pass /Zc:__cplusplus for __cplusplus to be set correctly. For now, I'm going to try just adding the flag, but if pki gets used in more places before we bump our minimum to C++17, we may want to start looking at _MSVC_LANG instead. There are actually a few places outside of pki that could use this, but we sadly can't use them until we require C++17 across the board. Bug: 661 Change-Id: I1002d9f2e1e4a2592760e8938560894d42a9b58c Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/65908 Reviewed-by: Bob Beck <bbe@google.com> Reviewed-by: Matt Mueller <mattm@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0639217..5933f02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,7 +203,11 @@ elseif(MSVC)
string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
${MSVC_DISABLED_WARNINGS_LIST})
set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")
- set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}")
+ # Without /Zc:__cplusplus, MSVC does not define the right value for
+ # __cplusplus. See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+ # If this becomes too problematic for downstream code, we can look at
+ # _MSVC_LANG.
+ set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR} -Zc:__cplusplus")
endif()
if(WIN32)