CMakeCXXCompilerId.cpp.in 1.68 KB
Newer Older
1 2 3
/* This source file must have a .cpp extension so that all C++ compilers
   recognize the extension without flags.  Borland does not know .cxx for
   example.  */
4 5 6 7
#ifndef __cplusplus
# error "A C compiler has been selected for C++."
#endif

8
@CMAKE_CXX_COMPILER_ID_CONTENT@
9

10 11 12 13
/* Construct the string literal in pieces to prevent the source from
   getting matched.  Store it in a pointer rather than an array
   because some compilers will just produce instructions to fill the
   array rather than assigning a pointer to a static array.  */
14
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
15 16 17
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif
18

19
#ifdef __QNXNTO__
20
char const* qnxnto = "INFO" ":" "qnxnto[]";
21 22
#endif

23 24 25 26
#if defined(__CRAYXE) || defined(__CRAYXC)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif

27
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
28
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
29

30 31 32 33 34 35 36 37 38 39
const char* info_language_dialect_default = "INFO" ":" "dialect_default["
#if __cplusplus >= 201402L
  "14"
#elif __cplusplus >= 201103L
  "11"
#else
  "98"
#endif
"]";

40 41 42 43 44 45 46
/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
47 48
#ifdef COMPILER_VERSION_MAJOR
  require += info_version[argc];
49 50 51 52 53 54
#endif
#ifdef SIMULATE_ID
  require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
  require += info_simulate_version[argc];
55 56 57
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
  require += info_cray[argc];
58
#endif
59
  require += info_language_dialect_default[argc];
60 61 62
  (void)argv;
  return require;
}