summaryrefslogtreecommitdiffstats
path: root/Modules/CMakePlatformId.h.in
diff options
context:
space:
mode:
authorGunnar Roth <gunnar.roth@gmx.de>2015-02-13 15:11:38 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-24 14:33:08 (GMT)
commit886dcaa7c5f91269b91da857d6eb2db3610d385e (patch)
treecf6346475b1ec209ded3f14320d62a2e68fb491a /Modules/CMakePlatformId.h.in
parentea98667682f29e8f900c01c5c36eebebf80ea8c7 (diff)
downloadCMake-886dcaa7c5f91269b91da857d6eb2db3610d385e.zip
CMake-886dcaa7c5f91269b91da857d6eb2db3610d385e.tar.gz
CMake-886dcaa7c5f91269b91da857d6eb2db3610d385e.tar.bz2
MSVC: Distinguish among ARM architectures more precisely (#14552)
Detect the exact ARM architecture instead of just "ARM". Treat "ARM" as an architecture family that includes THUMB (ARMV4I and ARMV5I).
Diffstat (limited to 'Modules/CMakePlatformId.h.in')
-rw-r--r--Modules/CMakePlatformId.h.in11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index bc26c07..da99b9e 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -1,3 +1,6 @@
+#define STRINGIFY_HELPER(X) #X
+#define STRINGIFY(X) STRINGIFY_HELPER(X)
+
/* Identify known platforms by name. */
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
@@ -112,7 +115,13 @@
# define ARCHITECTURE_ID "X86"
# elif defined(_M_ARM)
-# define ARCHITECTURE_ID "ARM"
+# if _M_ARM == 4
+# define ARCHITECTURE_ID "ARMV4I"
+# elif _M_ARM == 5
+# define ARCHITECTURE_ID "ARMV5I"
+# else
+# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
+# endif
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"