CMakeCCompilerId.c.in 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifdef __cplusplus
  2. # error "A C++ compiler has been selected for C."
  3. #endif
  4. #if defined(__18CXX)
  5. # define ID_VOID_MAIN
  6. #endif
  7. @CMAKE_C_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. @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
  20. @CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
  21. const char* info_language_dialect_default = "INFO" ":" "dialect_default["
  22. #if !defined(__STDC_VERSION__)
  23. "90"
  24. #elif __STDC_VERSION__ >= 201000L
  25. "11"
  26. #elif __STDC_VERSION__ >= 199901L
  27. "99"
  28. #else
  29. #endif
  30. "]";
  31. /*--------------------------------------------------------------------------*/
  32. #ifdef ID_VOID_MAIN
  33. void main() {}
  34. #else
  35. int main(int argc, char* argv[])
  36. {
  37. int require = 0;
  38. require += info_compiler[argc];
  39. require += info_platform[argc];
  40. require += info_arch[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. (void)argv;
  51. return require;
  52. }
  53. #endif