2 # error "A C++ compiler has been selected for C."
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"
25 # define COMPILER_ID "Compaq"
27 #elif defined(__IBMC__)
28 # if defined(__COMPILER_VER__)
29 # define COMPILER_ID "zOS"
30 # elif __IBMC__ >= 800
31 # define COMPILER_ID "XL"
33 # define COMPILER_ID "VisualAge"
37 # define COMPILER_ID "PGI"
39 #elif defined(__GNUC__)
40 # define COMPILER_ID "GNU"
42 #elif defined(_MSC_VER)
43 # define COMPILER_ID "MSVC"
45 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
46 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
48 # define COMPILER_ID "ADSP"
50 /* IAR Systems compiler for embedded systems.
52 Not supported yet by CMake
53 #elif defined(__IAR_SYSTEMS_ICC__)
54 # define COMPILER_ID "IAR" */
56 /* sdcc, the small devices C compiler for embedded systems,
57 http://sdcc.sourceforge.net */
59 # define COMPILER_ID "SDCC"
61 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
62 # define COMPILER_ID "MIPSpro"
64 /* This compiler is either not known or is too old to define an
65 identification macro. Try to identify the platform and guess that
66 it is the native compiler. */
68 # define COMPILER_ID "MIPSpro"
70 #elif defined(__hpux) || defined(__hpua)
71 # define COMPILER_ID "HP"
73 #else /* unknown compiler */
74 # define COMPILER_ID ""
78 /* Construct the string literal in pieces to prevent the source from
79 getting matched. Store it in a pointer rather than an array
80 because some compilers will just produce instructions to fill the
81 array rather than assigning a pointer to a static array. */
82 char* info_compiler
= "INFO" ":" "compiler[" COMPILER_ID
"]";
84 @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
86 /*--------------------------------------------------------------------------*/
91 int main(int argc
, char* argv
[])
94 require
+= info_compiler
[argc
];
95 require
+= info_platform
[argc
];