CMakeOBJCXXCompilerId.mm.in 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "An Objective-C compiler has been selected for Objective-C++."
  6. #endif
  7. @CMAKE_OBJCXX_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_OBJCXX_COMPILER_ID_PLATFORM_CONTENT@
  20. @CMAKE_OBJCXX_COMPILER_ID_ERROR_FOR_TEST@
  21. #if defined(_MSC_VER) && defined(_MSVC_LANG)
  22. #define CXX_STD _MSVC_LANG
  23. #else
  24. #define CXX_STD __cplusplus
  25. #endif
  26. const char* info_language_dialect_default = "INFO" ":" "dialect_default["
  27. #if CXX_STD > 201703L
  28. "20"
  29. #elif CXX_STD >= 201703L
  30. "17"
  31. #elif CXX_STD >= 201402L
  32. "14"
  33. #elif CXX_STD >= 201103L
  34. "11"
  35. #else
  36. "98"
  37. #endif
  38. "]";
  39. /*--------------------------------------------------------------------------*/
  40. int main(int argc, char* argv[])
  41. {
  42. int require = 0;
  43. require += info_compiler[argc];
  44. require += info_platform[argc];
  45. #ifdef COMPILER_VERSION_MAJOR
  46. require += info_version[argc];
  47. #endif
  48. #ifdef COMPILER_VERSION_INTERNAL
  49. require += info_version_internal[argc];
  50. #endif
  51. #ifdef SIMULATE_ID
  52. require += info_simulate[argc];
  53. #endif
  54. #ifdef SIMULATE_VERSION_MAJOR
  55. require += info_simulate_version[argc];
  56. #endif
  57. require += info_language_dialect_default[argc];
  58. (void)argv;
  59. return require;
  60. }