CMakeOBJCCompilerId.m.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifdef __cplusplus
  2. # error "An Objective-C++ compiler has been selected for Objective-C."
  3. #endif
  4. @CMAKE_OBJC_COMPILER_ID_CONTENT@
  5. /* Construct the string literal in pieces to prevent the source from
  6. getting matched. Store it in a pointer rather than an array
  7. because some compilers will just produce instructions to fill the
  8. array rather than assigning a pointer to a static array. */
  9. char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
  10. #ifdef SIMULATE_ID
  11. char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
  12. #endif
  13. #ifdef __QNXNTO__
  14. char const* qnxnto = "INFO" ":" "qnxnto[]";
  15. #endif
  16. @CMAKE_OBJC_COMPILER_ID_PLATFORM_CONTENT@
  17. @CMAKE_OBJC_COMPILER_ID_ERROR_FOR_TEST@
  18. #if !defined(__STDC__)
  19. # if (defined(_MSC_VER) && !defined(__clang__)) \
  20. || (defined(__ibmxl__) || defined(__IBMC__))
  21. # define C_DIALECT "90"
  22. # else
  23. # define C_DIALECT
  24. # endif
  25. #elif __STDC_VERSION__ >= 201000L
  26. # define C_DIALECT "11"
  27. #elif __STDC_VERSION__ >= 199901L
  28. # define C_DIALECT "99"
  29. #else
  30. # define C_DIALECT "90"
  31. #endif
  32. const char* info_language_dialect_default =
  33. "INFO" ":" "dialect_default[" C_DIALECT "]";
  34. /*--------------------------------------------------------------------------*/
  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 COMPILER_VERSION_INTERNAL
  45. require += info_version_internal[argc];
  46. #endif
  47. #ifdef SIMULATE_ID
  48. require += info_simulate[argc];
  49. #endif
  50. #ifdef SIMULATE_VERSION_MAJOR
  51. require += info_simulate_version[argc];
  52. #endif
  53. require += info_language_dialect_default[argc];
  54. (void)argv;
  55. return require;
  56. }