CMakeCXXCompilerId.cpp 1.7 KB

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