diff options
author | Brad King <brad.king@kitware.com> | 2011-12-06 16:56:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-12-07 13:59:52 (GMT) |
commit | a66285583d5d5426ead606dd1175f0c6d664ce47 (patch) | |
tree | 43f66eb483850399423c98506da4d1cc4d116849 /Modules/CMakeCXXCompilerId.cpp.in | |
parent | fa7141f5ad9bc084fefbb898c6cdda9312c5f615 (diff) | |
download | CMake-a66285583d5d5426ead606dd1175f0c6d664ce47.zip CMake-a66285583d5d5426ead606dd1175f0c6d664ce47.tar.gz CMake-a66285583d5d5426ead606dd1175f0c6d664ce47.tar.bz2 |
Detect GNU compiler version with its id (#6251)
Decode decimal digits from
__GNUC__
__GNUC_MINOR__
__GNUC_PATCHLEVEL__
to compute version components. See documentation at
http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
http://predef.sourceforge.net/precomp.html
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 469290e..6494c27 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -55,6 +55,11 @@ #elif defined(__GNUC__) # define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif #elif defined(_MSC_VER) # define COMPILER_ID "MSVC" |