CMakeCCompilerId.c 1.4 KB

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