CMakeCXXCompilerId.cpp.in 1.27 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
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
24
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
25 26 27 28 29 30 31 32

/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
33 34
#ifdef COMPILER_VERSION_MAJOR
  require += info_version[argc];
35 36 37 38 39 40
#endif
#ifdef SIMULATE_ID
  require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
  require += info_simulate_version[argc];
41
#endif
42 43 44
  (void)argv;
  return require;
}