CMakeCXXCompilerId.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # define COMPILER_ID "VisualAge"
  23. #elif defined(__PGI)
  24. # define COMPILER_ID "PGI"
  25. #elif defined(__GNUC__)
  26. # define COMPILER_ID "GNU"
  27. #elif defined(_MSC_VER)
  28. # define COMPILER_ID "MSVC"
  29. #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
  30. /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
  31. SHARC (21000) DSPs */
  32. # define COMPILER_ID "ADSP"
  33. #elif defined(_COMPILER_VERSION)
  34. # define COMPILER_ID "MIPSpro"
  35. /* This compiler is either not known or is too old to define an
  36. identification macro. Try to identify the platform and guess that
  37. it is the native compiler. */
  38. #elif defined(__sgi)
  39. # define COMPILER_ID "MIPSpro"
  40. #elif defined(__hpux) || defined(__hpua)
  41. # define COMPILER_ID "HP"
  42. #else /* unknown compiler */
  43. # define COMPILER_ID ""
  44. #endif
  45. static char const info_compiler[] = "INFO:compiler[" COMPILER_ID "]";
  46. /* Include the platform identification source. */
  47. #include "CMakePlatformId.h"
  48. /* Make sure the information strings are referenced. */
  49. int main()
  50. {
  51. return (&info_compiler[0] != &info_platform[0]);
  52. }