summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-29 15:51:31 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-29 17:21:49 (GMT)
commit5695558f4a5f0d68cd1c200258b89d1524ff230f (patch)
treec5f0d140a1b870863e7a44352cd236027fecd7c0 /Modules
parent1adbe223cd10ee133f5137da028ed86ddef7cc4d (diff)
downloadCMake-5695558f4a5f0d68cd1c200258b89d1524ff230f.zip
CMake-5695558f4a5f0d68cd1c200258b89d1524ff230f.tar.gz
CMake-5695558f4a5f0d68cd1c200258b89d1524ff230f.tar.bz2
SDCC: Fix identification of current sdcc compiler
The sdcc compiler no longer defines the `SDCC` preprocessor macro. Instead `__SDCC_VERSION_MAJOR` and similar component-wise macros are defined. Use them instead if defined. Issue: #16746
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/SDCC-C-DetermineCompiler.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/Compiler/SDCC-C-DetermineCompiler.cmake b/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
index 1d7dd78..4c70c5e 100644
--- a/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
@@ -1,10 +1,16 @@
# sdcc, the small devices C compiler for embedded systems,
# http://sdcc.sourceforge.net */
-set(_compiler_id_pp_test "defined(SDCC)")
+set(_compiler_id_pp_test "defined(__SDCC_VERSION_MAJOR) || defined(SDCC)")
set(_compiler_id_version_compute "
+# if defined(__SDCC_VERSION_MAJOR)
+# define COMPILER_VERSION_MAJOR @MACRO_DEC@(__SDCC_VERSION_MAJOR)
+# define COMPILER_VERSION_MINOR @MACRO_DEC@(__SDCC_VERSION_MINOR)
+# define COMPILER_VERSION_PATCH @MACRO_DEC@(__SDCC_VERSION_PATCH)
+# else
/* SDCC = VRP */
# define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
# define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
-# define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC % 10)")
+# define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC % 10)
+# endif")