1
0

CMakeCCompilerId.c 1.8 KB

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