diff options
author | Brad King <brad.king@kitware.com> | 2012-08-22 15:48:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-22 15:48:07 (GMT) |
commit | e9bc502fb82d7e48e12d9a2bd380c137f6cbc03d (patch) | |
tree | d0f9c311fdca11b1750f204aee26b73d472cfb20 | |
parent | cca386b0a058c050a03c10bf1b9f1344aef7de3f (diff) | |
download | CMake-e9bc502fb82d7e48e12d9a2bd380c137f6cbc03d.zip CMake-e9bc502fb82d7e48e12d9a2bd380c137f6cbc03d.tar.gz CMake-e9bc502fb82d7e48e12d9a2bd380c137f6cbc03d.tar.bz2 |
Detect Analog VisualDSP++ compiler version with its id
Decode hex digits from __VISUALDSPVERSION__ to compute the version
number components. Note that the constant encodes decimal digits as hex
digits (never larger than 9). We represent them as decimal after
extraction. See documentation at:
http://download.analog.com/dsp/tools/VisualDSP_45_Update_6_Release_Note_v4.pdf
http://www.analog.com/static/imported-files/software_manuals/50_asm_man.rev3.1.pdf
Note that __VISUALDSPVERSION__ was introduced in version 4.5.6.
-rw-r--r-- | Modules/CMakeCCompilerId.c.in | 11 | ||||
-rw-r--r-- | Modules/CMakeCXXCompilerId.cpp.in | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index f57a52a..c5bde9a 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -147,9 +147,16 @@ # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # endif +/* Analog VisualDSP++ >= 4.5.6 */ +#elif defined(__VISUALDSPVERSION__) +# define COMPILER_ID "ADSP" + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) + +/* Analog VisualDSP++ < 4.5.6 */ #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -/* Analog Devices C++ compiler for Blackfin, TigerSHARC and - SHARC (21000) DSPs */ # define COMPILER_ID "ADSP" /* IAR Systems compiler for embedded systems. diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index a784ba8..2c8dd4b 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -149,9 +149,16 @@ # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # endif +/* Analog VisualDSP++ >= 4.5.6 */ +#elif defined(__VISUALDSPVERSION__) +# define COMPILER_ID "ADSP" + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) + +/* Analog VisualDSP++ < 4.5.6 */ #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -/* Analog Devices C++ compiler for Blackfin, TigerSHARC and - SHARC (21000) DSPs */ # define COMPILER_ID "ADSP" #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) |