CMakeCXXCompilerId.cpp.in 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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(__PGI)
  24. # define COMPILER_ID "PGI"
  25. #elif defined(__GNUC__)
  26. # define COMPILER_ID "GNU"
  27. #elif defined(_MSC_VER)
  28. # define COMPILER_ID "MSVC"
  29. #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
  30. /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
  31. SHARC (21000) DSPs */
  32. # define COMPILER_ID "ADSP"
  33. #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
  34. # define COMPILER_ID "MIPSpro"
  35. /* This compiler is either not known or is too old to define an
  36. identification macro. Try to identify the platform and guess that
  37. it is the native compiler. */
  38. #elif defined(__sgi)
  39. # define COMPILER_ID "MIPSpro"
  40. #elif defined(__hpux) || defined(__hpua)
  41. # define COMPILER_ID "HP"
  42. #else /* unknown compiler */
  43. # define COMPILER_ID ""
  44. #endif
  45. /* Construct the string literal in pieces to prevent the source from
  46. getting matched. Store it in a pointer rather than an array
  47. because some compilers will just produce instructions to fill the
  48. array rather than assigning a pointer to a static array. */
  49. char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
  50. @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
  51. /*--------------------------------------------------------------------------*/
  52. int main(int argc, char* argv[])
  53. {
  54. int require = 0;
  55. require += info_compiler[argc];
  56. require += info_platform[argc];
  57. (void)argv;
  58. return require;
  59. }