summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authormakise-homura <akemi_homura@kurisa.ch>2021-10-19 18:43:45 (GMT)
committermakise-homura <akemi_homura@kurisa.ch>2021-10-21 14:24:22 (GMT)
commit3958ed878f2365fd1af004341d45dac7f4e94afb (patch)
tree0192b68ccf8fc248efadb1bf91deddc1927bf434 /Modules/Compiler
parent52ea22ca65d86627e9ab571f2a87d4a952a7d85e (diff)
downloadCMake-3958ed878f2365fd1af004341d45dac7f4e94afb.zip
CMake-3958ed878f2365fd1af004341d45dac7f4e94afb.tar.gz
CMake-3958ed878f2365fd1af004341d45dac7f4e94afb.tar.bz2
LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC, there should be a way for old projects to still identify it as GNU, as it was before. This commits adds the policy: CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU. This policy controls such a behavior. OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/LCC-C-DetermineCompiler.cmake8
-rw-r--r--Modules/Compiler/LCC-CXX-DetermineCompiler.cmake8
2 files changed, 16 insertions, 0 deletions
diff --git a/Modules/Compiler/LCC-C-DetermineCompiler.cmake b/Modules/Compiler/LCC-C-DetermineCompiler.cmake
index 6c7a08f..2ce92fe 100644
--- a/Modules/Compiler/LCC-C-DetermineCompiler.cmake
+++ b/Modules/Compiler/LCC-C-DetermineCompiler.cmake
@@ -8,4 +8,12 @@ set(_compiler_id_version_compute "
# endif
# if defined(__LCC_MINOR__)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__LCC_MINOR__)
+# endif
+# if defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define @PREFIX@SIMULATE_ID \"GNU\"
+# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__GNUC__)
+# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define @PREFIX@SIMULATE_VERSION_PATCH @MACRO_DEC@(__GNUC_PATCHLEVEL__)
+# endif
# endif")
diff --git a/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake b/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake
index 6c7a08f..2ce92fe 100644
--- a/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake
+++ b/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake
@@ -8,4 +8,12 @@ set(_compiler_id_version_compute "
# endif
# if defined(__LCC_MINOR__)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__LCC_MINOR__)
+# endif
+# if defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define @PREFIX@SIMULATE_ID \"GNU\"
+# define @PREFIX@SIMULATE_VERSION_MAJOR @MACRO_DEC@(__GNUC__)
+# define @PREFIX@SIMULATE_VERSION_MINOR @MACRO_DEC@(__GNUC_MINOR__)
+# if defined(__GNUC_PATCHLEVEL__)
+# define @PREFIX@SIMULATE_VERSION_PATCH @MACRO_DEC@(__GNUC_PATCHLEVEL__)
+# endif
# endif")