summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Molchanov <akemi_homura@kurisa.ch>2022-06-20 23:07:28 +0300
committerBrad King <brad.king@kitware.com>2022-06-27 13:02:53 -0400
commit57da7a4925fe687f8a66e03034271f33936a7bc6 (patch)
treeb45178fc7fb6f189f646aea288a7521c84fb31f5
parent8321c3d08e2b332705ae6884aab3278049498a6d (diff)
downloadcmake-57da7a4925fe687f8a66e03034271f33936a7bc6.tar.gz
LCC: link with -lgfortran instead of -llfortran since 1.26.03
Since LCC 1.26.03, compiler developers decided to rename liblfortran to libgfortran (internal reference: mcstbug#131633), and despite it's stated that "-llfortran will be automatically treated as -lgfortran", it actually does not work (and there's even no symlinks like liblfortran.* -> libgfortran.*); so we have to explicitly choose which library we have to link in. Fixes: #23646
-rw-r--r--Modules/Platform/Linux-LCC-Fortran.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/Platform/Linux-LCC-Fortran.cmake b/Modules/Platform/Linux-LCC-Fortran.cmake
index d3a4cf47a5..bf2a1c2d68 100644
--- a/Modules/Platform/Linux-LCC-Fortran.cmake
+++ b/Modules/Platform/Linux-LCC-Fortran.cmake
@@ -1,3 +1,7 @@
include(Platform/Linux-LCC)
__linux_compiler_lcc(Fortran)
-set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran")
+if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS "1.26.03")
+ set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-llfortran")
+else()
+ set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-lgfortran")
+endif()