CMakeCXXCompilerId.cpp.in 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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
  7. #if defined(__COMO__)
  8. # define COMPILER_ID "Comeau"
  9. #elif defined(__INTEL_COMPILER) || defined(__ICC)
  10. # define COMPILER_ID "Intel"
  11. #elif defined(__clang__)
  12. # define COMPILER_ID "Clang"
  13. #elif defined(__BORLANDC__)
  14. # define COMPILER_ID "Borland"
  15. #elif defined(__WATCOMC__)
  16. # define COMPILER_ID "Watcom"
  17. #elif defined(__SUNPRO_CC)
  18. # define COMPILER_ID "SunPro"
  19. #elif defined(__HP_aCC)
  20. # define COMPILER_ID "HP"
  21. #elif defined(__DECCXX)
  22. # define COMPILER_ID "Compaq"
  23. #elif defined(__IBMCPP__)
  24. # if defined(__COMPILER_VER__)
  25. # define COMPILER_ID "zOS"
  26. # elif __IBMCPP__ >= 800
  27. # define COMPILER_ID "XL"
  28. # else
  29. # define COMPILER_ID "VisualAge"
  30. # endif
  31. #elif defined(__PGI)
  32. # define COMPILER_ID "PGI"
  33. #elif defined(__PATHSCALE__)
  34. # define COMPILER_ID "PathScale"
  35. #elif defined(_CRAYC)
  36. # define COMPILER_ID "Cray"
  37. #elif defined(__GNUC__)
  38. # define COMPILER_ID "GNU"
  39. #elif defined(_MSC_VER)
  40. # 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"
  45. #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
  46. # define COMPILER_ID "MIPSpro"
  47. /* This compiler is either not known or is too old to define an
  48. identification macro. Try to identify the platform and guess that
  49. it is the native compiler. */
  50. #elif defined(__sgi)
  51. # define COMPILER_ID "MIPSpro"
  52. #elif defined(__hpux) || defined(__hpua)
  53. # define COMPILER_ID "HP"
  54. #else /* unknown compiler */
  55. # define COMPILER_ID ""
  56. #endif
  57. /* Construct the string literal in pieces to prevent the source from
  58. getting matched. Store it in a pointer rather than an array
  59. because some compilers will just produce instructions to fill the
  60. array rather than assigning a pointer to a static array. */
  61. char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
  62. @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
  63. /*--------------------------------------------------------------------------*/
  64. int main(int argc, char* argv[])
  65. {
  66. int require = 0;
  67. require += info_compiler[argc];
  68. require += info_platform[argc];
  69. (void)argv;
  70. return require;
  71. }