summaryrefslogtreecommitdiff
path: root/Modules/Compiler/GHS-DetermineCompiler.cmake
diff options
context:
space:
mode:
authorFred Baksik <frodak17@gmail.com>2019-01-08 23:52:12 -0500
committerFred Baksik <frodak17@gmail.com>2019-01-16 10:42:04 -0500
commit72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb (patch)
tree33ba6fcac03fcd685893654e3933c02b7beb8d79 /Modules/Compiler/GHS-DetermineCompiler.cmake
parent436cc5e991c7be07610d7902a5ce2a00221ca0a2 (diff)
downloadcmake-72e0c115b771fe9e3f4b5a5b6bd3bcdade77a7cb.tar.gz
GHS: Add Compiler ID detection
-- Detect GHS compiler and version Detect ARCHITECTURE_ID for PPC / ARM / 86 targets Detect PLATFORM_ID for Integrity and Integrity178 platforms Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86 -- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator Works around issue with some GHS compilers not setting __ghs__ compiler define -- Tweak Compiler ID checking so major id of 002017 is not replaced with 217 -- Prefer try_compile() library targets when testing for working GHS compilers -- Avoid CMake errors if reading past end of file for checking if file is PE executable
Diffstat (limited to 'Modules/Compiler/GHS-DetermineCompiler.cmake')
-rw-r--r--Modules/Compiler/GHS-DetermineCompiler.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake
index 56d24e266c..368b3759d7 100644
--- a/Modules/Compiler/GHS-DetermineCompiler.cmake
+++ b/Modules/Compiler/GHS-DetermineCompiler.cmake
@@ -1,6 +1,9 @@
-set(_compiler_id_pp_test "defined(__INTEGRITY)")
+set(_compiler_id_pp_test "defined(__ghs__)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION)
-# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION)
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)")
+/* __GHS_VERSION_NUMBER = VVVVRP */
+# ifdef __GHS_VERSION_NUMBER
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__GHS_VERSION_NUMBER % 10)
+# endif")