1 /* This source file must have a .cpp extension so that all C++ compilers
2 recognize the extension without flags. Borland does not know .cxx for
5 # error "A C compiler has been selected for C++."
8 #if !defined(__has_include)
9 /* If the compiler does not have __has_include, pretend the answer is
11 # define __has_include(x) 0
14 @CMAKE_CXX_COMPILER_ID_CONTENT@
16 /* Construct the string literal in pieces to prevent the source from
17 getting matched. Store it in a pointer rather than an array
18 because some compilers will just produce instructions to fill the
19 array rather than assigning a pointer to a static array. */
20 char const* info_compiler
= "INFO" ":" "compiler[" COMPILER_ID
"]";
22 char const* info_simulate
= "INFO" ":" "simulate[" SIMULATE_ID
"]";
26 char const* qnxnto
= "INFO" ":" "qnxnto[]";
29 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
30 char const *info_cray
= "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
33 @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
34 @CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
36 #define CXX_STD_98 199711L
37 #define CXX_STD_11 201103L
38 #define CXX_STD_14 201402L
39 #define CXX_STD_17 201703L
40 #define CXX_STD_20 202002L
41 #define CXX_STD_23 202302L
43 #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
44 # if _MSVC_LANG > CXX_STD_17
45 # define CXX_STD _MSVC_LANG
46 # elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
47 # define CXX_STD CXX_STD_20
48 # elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
49 # define CXX_STD CXX_STD_20
50 # elif _MSVC_LANG > CXX_STD_14
51 # define CXX_STD CXX_STD_17
52 # elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
53 # define CXX_STD CXX_STD_14
54 # elif defined(__INTEL_CXX11_MODE__)
55 # define CXX_STD CXX_STD_11
57 # define CXX_STD CXX_STD_98
59 #elif defined(_MSC_VER) && defined(_MSVC_LANG)
60 # if _MSVC_LANG > __cplusplus
61 # define CXX_STD _MSVC_LANG
63 # define CXX_STD __cplusplus
65 #elif defined(__NVCOMPILER)
66 # if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
67 # define CXX_STD CXX_STD_20
69 # define CXX_STD __cplusplus
71 #elif defined(__INTEL_COMPILER) || defined(__PGI)
72 # if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
73 # define CXX_STD CXX_STD_17
74 # elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
75 # define CXX_STD CXX_STD_14
77 # define CXX_STD __cplusplus
79 #elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
80 # if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
81 # define CXX_STD CXX_STD_14
83 # define CXX_STD __cplusplus
85 #elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
86 # define CXX_STD CXX_STD_11
88 # define CXX_STD __cplusplus
91 const char* info_language_standard_default
= "INFO" ":" "standard_default["
92 #if CXX_STD > CXX_STD_20
94 #elif CXX_STD > CXX_STD_17
96 #elif CXX_STD > CXX_STD_14
98 #elif CXX_STD > CXX_STD_11
100 #elif CXX_STD >= CXX_STD_11
107 const char* info_language_extensions_default
= "INFO" ":" "extensions_default["
108 #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
109 defined(__TI_COMPILER_VERSION__)) && \
110 !defined(__STRICT_ANSI__)
117 /*--------------------------------------------------------------------------*/
119 int main(int argc
, char* argv
[])
122 require
+= info_compiler
[argc
];
123 require
+= info_platform
[argc
];
124 require
+= info_arch
[argc
];
125 #ifdef COMPILER_VERSION_MAJOR
126 require
+= info_version
[argc
];
128 #ifdef COMPILER_VERSION_INTERNAL
129 require
+= info_version_internal
[argc
];
132 require
+= info_simulate
[argc
];
134 #ifdef SIMULATE_VERSION_MAJOR
135 require
+= info_simulate_version
[argc
];
137 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
138 require
+= info_cray
[argc
];
140 require
+= info_language_standard_default
[argc
];
141 require
+= info_language_extensions_default
[argc
];