diff options
author | Brad King <brad.king@kitware.com> | 2008-02-25 14:23:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-25 14:23:14 (GMT) |
commit | 9211b0d23482c0fee8dc64171cf3524feb1ae446 (patch) | |
tree | 4b65eec4b9abab6658d2f35437d9021f8508c941 /Modules/CMakePlatformId.h.in | |
parent | 88bd02a5d1553d31e0d4d8ee6eef599c27abddf2 (diff) | |
download | CMake-9211b0d23482c0fee8dc64171cf3524feb1ae446.zip CMake-9211b0d23482c0fee8dc64171cf3524feb1ae446.tar.gz CMake-9211b0d23482c0fee8dc64171cf3524feb1ae446.tar.bz2 |
ENH: Improvied compiler identification robustness
- Write a single source file into the compiler id directory
- This avoid requiring the compiler to behave correctly with
respect to include rules and the current working directory
- Helps to identify cross-compiling toolchains with unusual
default behavior
Diffstat (limited to 'Modules/CMakePlatformId.h.in')
-rw-r--r-- | Modules/CMakePlatformId.h.in | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in new file mode 100644 index 0000000..f62eb36 --- /dev/null +++ b/Modules/CMakePlatformId.h.in @@ -0,0 +1,79 @@ +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +char info_platform[] = "INFO:platform[" PLATFORM_ID "]"; |