ENH: fix advanced bug
[cmake.git] / Modules / CMakeCXXCompilerId.cpp
blob86d65bde6de7b89df190551759af46cdd9afe067
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 "A C compiler has been selected for C++."
6 #endif
8 #if defined(__COMO__)
9 # define COMPILER_ID "Comeau"
11 #elif defined(__INTEL_COMPILER) || defined(__ICC)
12 # define COMPILER_ID "Intel"
14 #elif defined(__BORLANDC__)
15 # define COMPILER_ID "Borland"
17 #elif defined(__WATCOMC__)
18 # define COMPILER_ID "Watcom"
20 #elif defined(__SUNPRO_CC)
21 # define COMPILER_ID "SunPro"
23 #elif defined(__HP_aCC)
24 # define COMPILER_ID "HP"
26 #elif defined(__DECCXX)
27 # define COMPILER_ID "Compaq"
29 #elif defined(__IBMCPP__)
30 # define COMPILER_ID "VisualAge"
32 #elif defined(__PGI)
33 # define COMPILER_ID "PGI"
35 #elif defined(__GNUC__)
36 # define COMPILER_ID "GNU"
38 #elif defined(_MSC_VER)
39 # define COMPILER_ID "MSVC"
41 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
42 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
43 SHARC (21000) DSPs */
44 # define COMPILER_ID "ADSP"
46 #elif defined(_COMPILER_VERSION)
47 # define COMPILER_ID "MIPSpro"
49 /* This compiler is either not known or is too old to define an
50 identification macro. Try to identify the platform and guess that
51 it is the native compiler. */
52 #elif defined(__sgi)
53 # define COMPILER_ID "MIPSpro"
55 #elif defined(__hpux) || defined(__hpua)
56 # define COMPILER_ID "HP"
58 #else /* unknown compiler */
59 # define COMPILER_ID ""
61 #endif
63 static char const info_compiler[] = "INFO:compiler[" COMPILER_ID "]";
65 /* Include the platform identification source. */
66 #include "CMakePlatformId.h"
68 /* Make sure the information strings are referenced. */
69 int main()
71 return (&info_compiler[0] != &info_platform[0]);