CMakeCXXCompilerId.cpp.in 2.3 KB

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