CMakeCXXCompilerId.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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(_COMPILER_VERSION)
  28. # define COMPILER_ID "MIPSpro"
  29. /* This compiler is either not known or is too old to define an
  30. identification macro. Try to identify the platform and guess that
  31. it is the native compiler. */
  32. #elif defined(__sgi)
  33. # define COMPILER_ID "MIPSpro"
  34. #elif defined(__hpux) || defined(__hpua)
  35. # define COMPILER_ID "HP"
  36. #else /* unknown compiler */
  37. # define COMPILER_ID ""
  38. #endif
  39. static char const info_compiler[] = "INFO:compiler[" COMPILER_ID "]";
  40. /* Include the platform identification source. */
  41. #include "CMakePlatformId.h"
  42. /* Make sure the information strings are referenced. */
  43. int main()
  44. {
  45. return (&info_compiler[0] != &info_platform[0]);
  46. }