diff options
author | Brad King <brad.king@kitware.com> | 2012-01-10 18:22:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-01-10 18:24:38 (GMT) |
commit | a5e892ca1fbcbeefbe080305aa847d35bd7f930a (patch) | |
tree | 9b87f123580e4b602508d24265c8c457ac42ab91 /Modules/CMakeCXXCompilerId.cpp.in | |
parent | d7c6f410f98123af03322bd916e49b9e21d90310 (diff) | |
download | CMake-a5e892ca1fbcbeefbe080305aa847d35bd7f930a.zip CMake-a5e892ca1fbcbeefbe080305aa847d35bd7f930a.tar.gz CMake-a5e892ca1fbcbeefbe080305aa847d35bd7f930a.tar.bz2 |
Document compiler version macro formats used for detection
The MSVC, HP, XL, SunPro, Watcom, Borland, and Intel compilers specify
their version number in components encoded in a single integer value.
Document the components that we use to compute version numbers.
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index bf4eaf9..dc3f1d7 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -5,15 +5,20 @@ # error "A C compiler has been selected for C++." #endif +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + #if defined(__COMO__) # define COMPILER_ID "Comeau" #elif defined(__INTEL_COMPILER) || defined(__ICC) # define COMPILER_ID "Intel" + /* __INTEL_COMPILER = VRP */ # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) # if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # endif @@ -25,21 +30,25 @@ #elif defined(__BORLANDC__) # define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) # 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) #elif defined(__SUNPRO_CC) # define COMPILER_ID "SunPro" # if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) # else + /* __SUNPRO_CC = 0xVRP */ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) @@ -47,6 +56,7 @@ #elif defined(__HP_aCC) # define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) @@ -63,6 +73,7 @@ # else # define COMPILER_ID "VisualAge" # endif + /* __IBMCPP__ = VRP */ # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) @@ -98,12 +109,15 @@ #elif defined(_MSC_VER) # define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) # if defined(_MSC_FULL_VER) # if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) # else + /* _MSC_FULL_VER = VVRRPPPP */ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) # endif # endif |