summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorJiri Malak <malak.jiri@gmail.com>2014-03-17 18:41:02 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-17 19:00:59 (GMT)
commit5d9aa66c91909b8d7eab16edb020c9a14205ba69 (patch)
tree0a0b30b2db44f47943add15d36eb1ff9a2c5e803 /Modules/CMakeCCompilerId.c.in
parent9292d3b8a016fb48f5b5b1518895b6d63e51bc2e (diff)
downloadCMake-5d9aa66c91909b8d7eab16edb020c9a14205ba69.zip
CMake-5d9aa66c91909b8d7eab16edb020c9a14205ba69.tar.gz
CMake-5d9aa66c91909b8d7eab16edb020c9a14205ba69.tar.bz2
Watcom: Introduce OpenWatcom compiler id and fix compiler version
Distinguish "Open Watcom" from old "Watcom" by introducing a new "OpenWatcom" compiler id. The __WATCOMC__ format is "VVRP" for Watcom and "VVRP + 1100" for Open Watcom.
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in17
1 files changed, 13 insertions, 4 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 561ccf2..16e19cd 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -68,10 +68,19 @@
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
- /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
+# if __WATCOMC__ < 1200
+# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRP */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# else
+# define COMPILER_ID "OpenWatcom"
+ /* __WATCOMC__ = VVRP + 1100 */
+# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
+# endif
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
#elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro"