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/CMakeCCompilerId.c.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/CMakeCCompilerId.c.in')
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index dd3d2fd..25e4947 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -53,6 +53,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" |