CMakeCCompilerId.c 1.7 KB

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