aboutsummaryrefslogtreecommitdiff
path: root/CMake/AbseilDll.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/AbseilDll.cmake')
-rw-r--r--CMake/AbseilDll.cmake25
1 files changed, 20 insertions, 5 deletions
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
index bf273ceb..47f3beeb 100644
--- a/CMake/AbseilDll.cmake
+++ b/CMake/AbseilDll.cmake
@@ -627,17 +627,32 @@ include(CheckCXXSourceCompiles)
check_cxx_source_compiles(
[==[
#ifdef _MSC_VER
-# if _MSVC_LANG < 201700L
+# if _MSVC_LANG < 201703L
# error "The compiler defaults or is configured for C++ < 17"
# endif
-#elif __cplusplus < 201700L
+#elif __cplusplus < 201703L
# error "The compiler defaults or is configured for C++ < 17"
#endif
int main() { return 0; }
]==]
ABSL_INTERNAL_AT_LEAST_CXX17)
-if(ABSL_INTERNAL_AT_LEAST_CXX17)
+check_cxx_source_compiles(
+ [==[
+#ifdef _MSC_VER
+# if _MSVC_LANG < 202002L
+# error "The compiler defaults or is configured for C++ < 20"
+# endif
+#elif __cplusplus < 202002L
+# error "The compiler defaults or is configured for C++ < 20"
+#endif
+int main() { return 0; }
+]==]
+ ABSL_INTERNAL_AT_LEAST_CXX20)
+
+if(ABSL_INTERNAL_AT_LEAST_CXX20)
+ set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
+elseif(ABSL_INTERNAL_AT_LEAST_CXX17)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
else()
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
@@ -807,8 +822,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
if(ABSL_PROPAGATE_CXX_STD)
# Abseil libraries require C++14 as the current minimum standard. When
- # compiled with C++17 (either because it is the compiler's default or
- # explicitly requested), then Abseil requires C++17.
+ # compiled with a higher minimum (either because it is the compiler's
+ # default or explicitly requested), then Abseil requires that standard.
target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
endif()