diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-11-20 02:58:42 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-11-20 02:58:42 (GMT) |
commit | 4430bccc700cd8b12164f9d1b5658a14e62dd0d5 (patch) | |
tree | 8eba965c471e5620fb2957d4fcc340235b503034 /Modules/CMakePlatformId.h.in | |
parent | 1699836b0632b5a16ceac7cfdcc76e0d753e0880 (diff) | |
download | CMake-4430bccc700cd8b12164f9d1b5658a14e62dd0d5.zip CMake-4430bccc700cd8b12164f9d1b5658a14e62dd0d5.tar.gz CMake-4430bccc700cd8b12164f9d1b5658a14e62dd0d5.tar.bz2 |
Change the way 32/64 bit compiles are detected with MSVC and intel makefile builds. Use the platform ID preprocessor approach.
Diffstat (limited to 'Modules/CMakePlatformId.h.in')
-rw-r--r-- | Modules/CMakePlatformId.h.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in index 8e786ba..9429469 100644 --- a/Modules/CMakePlatformId.h.in +++ b/Modules/CMakePlatformId.h.in @@ -82,8 +82,31 @@ #endif +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is becase + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# defined ARCHITECTURE_ID "" +# endif + +#endif + /* 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. */ char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + |