From 952651c6428755f50a80d3b64a4e09d3bd1afc3b Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 22 Aug 2012 10:15:58 -0400 Subject: [PATCH] Detect TI compiler version with its id Decode decimal digits from __TI_COMPILER_VERSION__ to compute version number components. See documentation at: http://processors.wiki.ti.com/index.php/Refer_to_Compiler_Version_in_Your_Source http://www.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spru187o http://sourceforge.net/p/predef/wiki/Compilers/#texas-instruments-cc-compiler --- Modules/CMakeCCompilerId.c.in | 4 ++++ Modules/CMakeCXXCompilerId.cpp.in | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 8b5b899a75..331be069e5 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -108,6 +108,10 @@ #elif defined(__TI_COMPILER_VERSION__) # define COMPILER_ID "TI_DSP" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) #elif defined(__TINYC__) # define COMPILER_ID "TinyCC" diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 80e6d19d82..acffbf4899 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -110,6 +110,10 @@ #elif defined(__TI_COMPILER_VERSION__) # define COMPILER_ID "TI_DSP" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) #elif defined(__SCO_VERSION__) # define COMPILER_ID "SCO"