summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake21
-rw-r--r--Modules/Compiler/LCC-C-DetermineCompiler.cmake8
-rw-r--r--Modules/Compiler/LCC-CXX-DetermineCompiler.cmake8
3 files changed, 37 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6437be0..ca90032 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -150,6 +150,27 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
endif()
+ # For LCC Fortran we need to explicitly query the version.
+ if(lang STREQUAL "Fortran"
+ AND CMAKE_${lang}_COMPILER_ID STREQUAL "LCC")
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ --version
+ OUTPUT_VARIABLE output ERROR_VARIABLE output
+ RESULT_VARIABLE result
+ TIMEOUT 10
+ )
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" --version\n"
+ "${output}\n"
+ )
+
+ if(output MATCHES [[\(GCC\) ([0-9]+\.[0-9]+(\.[0-9]+)?) compatible]])
+ set(CMAKE_${lang}_SIMULATE_ID "GNU")
+ set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+
if (COMPILER_QNXNTO AND (CMAKE_${lang}_COMPILER_ID STREQUAL "GNU" OR CMAKE_${lang}_COMPILER_ID STREQUAL "LCC"))
execute_process(
COMMAND "${CMAKE_${lang}_COMPILER}"
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")