Merge topic 'cpack-innosetup-linux'
[kiteware-cmake.git] / Modules / CMakeOBJCXXCompilerId.mm.in
blob2145b4046e0dd96b9aef433d7adc979ff9910e21
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
3 example. */
4 #ifndef __cplusplus
5 # error "An Objective-C compiler has been selected for Objective-C++."
6 #endif
8 @CMAKE_OBJCXX_COMPILER_ID_CONTENT@
10 /* Construct the string literal in pieces to prevent the source from
11 getting matched. Store it in a pointer rather than an array
12 because some compilers will just produce instructions to fill the
13 array rather than assigning a pointer to a static array. */
14 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
15 #ifdef SIMULATE_ID
16 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
17 #endif
19 #ifdef __QNXNTO__
20 char const* qnxnto = "INFO" ":" "qnxnto[]";
21 #endif
23 @CMAKE_OBJCXX_COMPILER_ID_PLATFORM_CONTENT@
24 @CMAKE_OBJCXX_COMPILER_ID_ERROR_FOR_TEST@
26 #if defined(_MSC_VER) && defined(_MSVC_LANG)
27 #define CXX_STD _MSVC_LANG
28 #else
29 #define CXX_STD __cplusplus
30 #endif
32 const char* info_language_standard_default = "INFO" ":" "standard_default["
33 #if CXX_STD > 202002L
34 "23"
35 #elfif CXX_STD > 201703L
36 "20"
37 #elif CXX_STD >= 201703L
38 "17"
39 #elif CXX_STD >= 201402L
40 "14"
41 #elif CXX_STD >= 201103L
42 "11"
43 #else
44 "98"
45 #endif
46 "]";
48 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
49 #if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__)
50 "ON"
51 #else
52 "OFF"
53 #endif
54 "]";
56 /*--------------------------------------------------------------------------*/
58 int main(int argc, char* argv[])
60 int require = 0;
61 require += info_compiler[argc];
62 require += info_platform[argc];
63 #ifdef COMPILER_VERSION_MAJOR
64 require += info_version[argc];
65 #endif
66 #ifdef COMPILER_VERSION_INTERNAL
67 require += info_version_internal[argc];
68 #endif
69 #ifdef SIMULATE_ID
70 require += info_simulate[argc];
71 #endif
72 #ifdef SIMULATE_VERSION_MAJOR
73 require += info_simulate_version[argc];
74 #endif
75 require += info_language_standard_default[argc];
76 require += info_language_extensions_default[argc];
77 (void)argv;
78 return require;