CMakeCXXCompilerId.cpp.in 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. @CMAKE_CXX_COMPILER_ID_CONTENT@
  8. /* Construct the string literal in pieces to prevent the source from
  9. getting matched. Store it in a pointer rather than an array
  10. because some compilers will just produce instructions to fill the
  11. array rather than assigning a pointer to a static array. */
  12. char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
  13. #ifdef SIMULATE_ID
  14. char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
  15. #endif
  16. #ifdef __QNXNTO__
  17. char const* qnxnto = "INFO" ":" "qnxnto[]";
  18. #endif
  19. #if defined(__CRAYXE) || defined(__CRAYXC)
  20. char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
  21. #endif
  22. @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
  23. @CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
  24. const char* info_language_dialect_default = "INFO" ":" "dialect_default["
  25. #if __cplusplus > 201402L
  26. "17"
  27. #elif __cplusplus >= 201402L
  28. "14"
  29. #elif __cplusplus >= 201103L
  30. "11"
  31. #else
  32. "98"
  33. #endif
  34. "]";
  35. /*--------------------------------------------------------------------------*/
  36. int main(int argc, char* argv[])
  37. {
  38. int require = 0;
  39. require += info_compiler[argc];
  40. require += info_platform[argc];
  41. #ifdef COMPILER_VERSION_MAJOR
  42. require += info_version[argc];
  43. #endif
  44. #ifdef SIMULATE_ID
  45. require += info_simulate[argc];
  46. #endif
  47. #ifdef SIMULATE_VERSION_MAJOR
  48. require += info_simulate_version[argc];
  49. #endif
  50. #if defined(__CRAYXE) || defined(__CRAYXC)
  51. require += info_cray[argc];
  52. #endif
  53. require += info_language_dialect_default[argc];
  54. (void)argv;
  55. return require;
  56. }