generated from Mizux/cmake-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabseil-cpp-20240722.0.patch
79 lines (74 loc) · 2.26 KB
/
abseil-cpp-20240722.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
index 32cc28f..e51d6df 100644
--- a/CMake/AbseilDll.cmake
+++ b/CMake/AbseilDll.cmake
@@ -699,31 +699,44 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS
include(CheckCXXSourceCompiles)
-check_cxx_source_compiles(
- [==[
-#ifdef _MSC_VER
-# if _MSVC_LANG < 201703L
-# error "The compiler defaults or is configured for C++ < 17"
-# endif
-#elif __cplusplus < 201703L
-# error "The compiler defaults or is configured for C++ < 17"
-#endif
-int main() { return 0; }
-]==]
+message(WARNING "ABSL_CXX_STANDARD: ${ABSL_CXX_STANDARD}")
+message(WARNING "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
+message(WARNING "CMAKE_CXX_STANDARD_REQUIRED: ${CMAKE_CXX_STANDARD_REQUIRED}")
+message(WARNING "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 17)
+ set(ABSL_INTERNAL_AT_LEAST_CXX17 TRUE)
+else()
+ check_cxx_source_compiles(
+ [==[
+ #ifdef _MSC_VER
+ # if _MSVC_LANG < 201703L
+ # error "The compiler defaults or is configured for C++ < 17"
+ # endif
+ #elif __cplusplus < 201703L
+ # error "The compiler defaults or is configured for C++ < 17"
+ #endif
+ int main() { return 0; }
+ ]==]
ABSL_INTERNAL_AT_LEAST_CXX17)
+endif()
-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; }
-]==]
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
+ set(ABSL_INTERNAL_AT_LEAST_CXX20 TRUE)
+else()
+ 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)
+endif()
if(ABSL_INTERNAL_AT_LEAST_CXX20)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
@@ -731,6 +744,7 @@ 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)
+ message(FATAL_ERROR "Should not pass here !!!")
endif()
function(absl_internal_dll_contains)