Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Modules / CMakeCCompilerId.c.in
blob35d7df77a8bea787ad4e85619d18954e29b2ddb5
1 #ifdef __cplusplus
2 # error "A C++ compiler has been selected for C."
3 #endif
5 #if defined(__18CXX)
6 # define ID_VOID_MAIN
7 #endif
9 #if defined(__INTEL_COMPILER) || defined(__ICC)
10 # define COMPILER_ID "Intel"
12 #elif defined(__BORLANDC__)
13 # define COMPILER_ID "Borland"
15 #elif defined(__WATCOMC__)
16 # define COMPILER_ID "Watcom"
18 #elif defined(__SUNPRO_C)
19 # define COMPILER_ID "SunPro"
21 #elif defined(__HP_cc)
22 # define COMPILER_ID "HP"
24 #elif defined(__DECC)
25 # define COMPILER_ID "Compaq"
27 #elif defined(__IBMC__)
28 # define COMPILER_ID "VisualAge"
30 #elif defined(__PGI)
31 # define COMPILER_ID "PGI"
33 #elif defined(__GNUC__)
34 # define COMPILER_ID "GNU"
36 #elif defined(_MSC_VER)
37 # define COMPILER_ID "MSVC"
39 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
40 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
41 SHARC (21000) DSPs */
42 # define COMPILER_ID "ADSP"
44 /* IAR Systems compiler for embedded systems.
45 http://www.iar.com
46 Not supported yet by CMake
47 #elif defined(__IAR_SYSTEMS_ICC__)
48 # define COMPILER_ID "IAR" */
50 /* sdcc, the small devices C compiler for embedded systems,
51 http://sdcc.sourceforge.net */
52 #elif defined(SDCC)
53 # define COMPILER_ID "SDCC"
55 #elif defined(_COMPILER_VERSION)
56 # define COMPILER_ID "MIPSpro"
58 /* This compiler is either not known or is too old to define an
59 identification macro. Try to identify the platform and guess that
60 it is the native compiler. */
61 #elif defined(__sgi)
62 # define COMPILER_ID "MIPSpro"
64 #elif defined(__hpux) || defined(__hpua)
65 # define COMPILER_ID "HP"
67 #else /* unknown compiler */
68 # define COMPILER_ID ""
70 #endif
72 /* Construct the string literal in pieces to prevent the source from
73 getting matched. Store it in a pointer rather than an array
74 because some compilers will just produce instructions to fill the
75 array rather than assigning a pointer to a static array. */
76 char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
78 @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
80 /*--------------------------------------------------------------------------*/
82 #ifdef ID_VOID_MAIN
83 void main() {}
84 #else
85 int main(int argc, char* argv[])
87 int require = 0;
88 require += info_compiler[argc];
89 require += info_platform[argc];
90 (void)argv;
91 return require;
93 #endif