CMakePlatformId.h.in 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* Identify known platforms by name. */
  2. #if defined(__linux) || defined(__linux__) || defined(linux)
  3. # define PLATFORM_ID "Linux"
  4. #elif defined(__CYGWIN__)
  5. # define PLATFORM_ID "Cygwin"
  6. #elif defined(__MINGW32__)
  7. # define PLATFORM_ID "MinGW"
  8. #elif defined(__APPLE__)
  9. # define PLATFORM_ID "Darwin"
  10. #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
  11. # define PLATFORM_ID "Windows"
  12. #elif defined(__FreeBSD__) || defined(__FreeBSD)
  13. # define PLATFORM_ID "FreeBSD"
  14. #elif defined(__NetBSD__) || defined(__NetBSD)
  15. # define PLATFORM_ID "NetBSD"
  16. #elif defined(__OpenBSD__) || defined(__OPENBSD)
  17. # define PLATFORM_ID "OpenBSD"
  18. #elif defined(__sun) || defined(sun)
  19. # define PLATFORM_ID "SunOS"
  20. #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  21. # define PLATFORM_ID "AIX"
  22. #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
  23. # define PLATFORM_ID "IRIX"
  24. #elif defined(__hpux) || defined(__hpux__)
  25. # define PLATFORM_ID "HP-UX"
  26. #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
  27. # define PLATFORM_ID "Haiku"
  28. /* Haiku also defines __BEOS__ so we must
  29. put it prior to the check for __BEOS__
  30. */
  31. #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
  32. # define PLATFORM_ID "BeOS"
  33. #elif defined(__QNX__) || defined(__QNXNTO__)
  34. # define PLATFORM_ID "QNX"
  35. #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
  36. # define PLATFORM_ID "Tru64"
  37. #elif defined(__riscos) || defined(__riscos__)
  38. # define PLATFORM_ID "RISCos"
  39. #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
  40. # define PLATFORM_ID "SINIX"
  41. #elif defined(__UNIX_SV__)
  42. # define PLATFORM_ID "UNIX_SV"
  43. #elif defined(__bsdos__)
  44. # define PLATFORM_ID "BSDOS"
  45. #elif defined(_MPRAS) || defined(MPRAS)
  46. # define PLATFORM_ID "MP-RAS"
  47. #elif defined(__osf) || defined(__osf__)
  48. # define PLATFORM_ID "OSF1"
  49. #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
  50. # define PLATFORM_ID "SCO_SV"
  51. #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
  52. # define PLATFORM_ID "ULTRIX"
  53. #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
  54. # define PLATFORM_ID "Xenix"
  55. #else /* unknown platform */
  56. # define PLATFORM_ID ""
  57. #endif
  58. /* For windows compilers MSVC and Intel we can determine
  59. the architecture of the compiler being used. This is becase
  60. the compilers do not have flags that can change the architecture,
  61. but rather depend on which compiler is being used
  62. */
  63. #if defined(_WIN32) && defined(_MSC_VER)
  64. # if defined(_M_IA64)
  65. # define ARCHITECTURE_ID "IA64"
  66. # elif defined(_M_X64) || defined(_M_AMD64)
  67. # define ARCHITECTURE_ID "x64"
  68. # elif defined(_M_IX86)
  69. # define ARCHITECTURE_ID "X86"
  70. # else /* unknown architecture */
  71. # define ARCHITECTURE_ID ""
  72. # endif
  73. #else
  74. # define ARCHITECTURE_ID ""
  75. #endif
  76. /* Construct the string literal in pieces to prevent the source from
  77. getting matched. Store it in a pointer rather than an array
  78. because some compilers will just produce instructions to fill the
  79. array rather than assigning a pointer to a static array. */
  80. char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
  81. char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";