summaryrefslogtreecommitdiff
path: root/Modules/CMakeCXXCompilerId.cpp.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-22 11:48:07 -0400
committerBrad King <brad.king@kitware.com>2012-08-22 11:48:07 -0400
commite9bc502fb82d7e48e12d9a2bd380c137f6cbc03d (patch)
treed0f9c311fdca11b1750f204aee26b73d472cfb20 /Modules/CMakeCXXCompilerId.cpp.in
parentcca386b0a058c050a03c10bf1b9f1344aef7de3f (diff)
downloadcmake-e9bc502fb82d7e48e12d9a2bd380c137f6cbc03d.tar.gz
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.
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index a784ba8856..2c8dd4bc7e 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)