CMakeCCompilerId.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifdef __cplusplus
  2. # error "A C++ compiler has been selected for C."
  3. #endif
  4. #ifdef __CLASSIC_C__
  5. # define const
  6. #endif
  7. #if defined(__INTEL_COMPILER) || defined(__ICC)
  8. #define _COMPILER_ID "Intel"
  9. #elif defined(__BORLANDC__)
  10. #define _COMPILER_ID "Borland"
  11. #elif defined(__WATCOMC__)
  12. #define _COMPILER_ID "Watcom"
  13. #elif defined(__SUNPRO_C)
  14. #define _COMPILER_ID "SunPro"
  15. #elif defined(__HP_cc)
  16. #define _COMPILER_ID "HP"
  17. #elif defined(__DECC)
  18. #define _COMPILER_ID "Compaq"
  19. #elif defined(__IBMC__)
  20. #define _COMPILER_ID "VisualAge"
  21. #elif defined(__GNUC__)
  22. #define _COMPILER_ID "GNU"
  23. #elif defined(_MSC_VER)
  24. #define _COMPILER_ID "MSVC"
  25. #elif defined(_COMPILER_VERSION)
  26. #define _COMPILER_ID "MIPSpro"
  27. /* This compiler is either not known or is too old to define an
  28. identification macro. Try to identify the platform and guess that
  29. it is the native compiler. */
  30. #elif defined(__sgi)
  31. #define _COMPILER_ID "MIPSpro"
  32. #elif defined(__hpux) || defined(__hpua)
  33. #define _COMPILER_ID "HP"
  34. #else /* unknown compiler */
  35. #define _COMPILER_ID ""
  36. #endif
  37. static char const info_compiler[] = "INFO:compiler[" _COMPILER_ID "]";
  38. /* Include the platform identification source. */
  39. #include "CMakePlatformId.h"
  40. /* Make sure the information strings are referenced. */
  41. int main()
  42. {
  43. return (&info_compiler[0] != &info_platform[0]);
  44. }