Browse Source

Detect Watcom compiler version with its id

Decode decimal digits from __WATCOMC__ to compute the version number
components.  See documentation at:

  http://predef.sourceforge.net/precomp.html
Brad King 14 years ago
parent
commit
c198730b45
2 changed files with 4 additions and 0 deletions
  1. 2 0
      Modules/CMakeCCompilerId.c.in
  2. 2 0
      Modules/CMakeCXXCompilerId.cpp.in

+ 2 - 0
Modules/CMakeCCompilerId.c.in

@@ -28,6 +28,8 @@
 
 #elif defined(__WATCOMC__)
 # define COMPILER_ID "Watcom"
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
 
 #elif defined(__SUNPRO_C)
 # define COMPILER_ID "SunPro"

+ 2 - 0
Modules/CMakeCXXCompilerId.cpp.in

@@ -30,6 +30,8 @@
 
 #elif defined(__WATCOMC__)
 # define COMPILER_ID "Watcom"
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
 
 #elif defined(__SUNPRO_CC)
 # define COMPILER_ID "SunPro"