CMakeCXXCompilerId.cpp.in 2.36 KB
Newer Older
1
2
3
/* This source file must have a .cpp extension so that all C++ compilers
   recognize the extension without flags.  Borland does not know .cxx for
   example.  */
4
5
6
7
8
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif

#if defined(__COMO__)
9
10
# define COMPILER_ID "Comeau"

11
#elif defined(__INTEL_COMPILER) || defined(__ICC)
12
13
# define COMPILER_ID "Intel"

14
15
16
#elif defined(__clang__)
# define COMPILER_ID "Clang"

17
#elif defined(__BORLANDC__)
18
19
# define COMPILER_ID "Borland"

20
#elif defined(__WATCOMC__)
21
22
# define COMPILER_ID "Watcom"

23
#elif defined(__SUNPRO_CC)
24
25
# define COMPILER_ID "SunPro"

26
#elif defined(__HP_aCC)
27
28
# define COMPILER_ID "HP"

29
#elif defined(__DECCXX)
30
31
# define COMPILER_ID "Compaq"

32
#elif defined(__IBMCPP__)
33
34
35
36
37
38
39
# if defined(__COMPILER_VER__)
#  define COMPILER_ID "zOS"
# elif __IBMCPP__ >= 800
#  define COMPILER_ID "XL"
# else
#  define COMPILER_ID "VisualAge"
# endif
40

Alexander Neundorf's avatar
   
Alexander Neundorf committed
41
42
43
#elif defined(__PGI)
# define COMPILER_ID "PGI"

44
45
46
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"

47
48
49
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"

50
#elif defined(__GNUC__)
51
52
# define COMPILER_ID "GNU"

53
#elif defined(_MSC_VER)
54
55
# define COMPILER_ID "MSVC"

Alexander Neundorf's avatar
   
Alexander Neundorf committed
56
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
57
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
Alexander Neundorf's avatar
   
Alexander Neundorf committed
58
59
60
   SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"

61
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
62
# define COMPILER_ID "MIPSpro"
63
64
65
66
67

/* This compiler is either not known or is too old to define an
   identification macro.  Try to identify the platform and guess that
   it is the native compiler.  */
#elif defined(__sgi)
68
69
# define COMPILER_ID "MIPSpro"

70
#elif defined(__hpux) || defined(__hpua)
71
# define COMPILER_ID "HP"
72
73

#else /* unknown compiler */
74
75
# define COMPILER_ID ""

76
#endif
77

78
79
80
81
82
/* Construct the string literal in pieces to prevent the source from
   getting matched.  Store it in a pointer rather than an array
   because some compilers will just produce instructions to fill the
   array rather than assigning a pointer to a static array.  */
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
83

84
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
85
86
87
88
89
90
91
92
93
94
95

/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
  (void)argv;
  return require;
}