summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFortranInformation.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-12 12:43:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-12 12:43:32 (GMT)
commitc9cd039e5f312f2717c6522ac7117791856f734b (patch)
treeb58053d2319951dbff155e1453d1fe3969065403 /Modules/CMakeFortranInformation.cmake
parent2d830247bae808cc68f26288ff72768b21d0c102 (diff)
parent14e57e9637964594461711954c6c906bc22eb7c7 (diff)
downloadCMake-c9cd039e5f312f2717c6522ac7117791856f734b.zip
CMake-c9cd039e5f312f2717c6522ac7117791856f734b.tar.gz
CMake-c9cd039e5f312f2717c6522ac7117791856f734b.tar.bz2
Merge topic 'LWYU-externalization'
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration 9c5132a586 PGI: Fix "LINKER:" prefix generated separator 8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6306
Diffstat (limited to 'Modules/CMakeFortranInformation.cmake')
-rw-r--r--Modules/CMakeFortranInformation.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 9a4ce63..0f71c6f 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -157,6 +157,15 @@ if(NOT CMAKE_INCLUDE_FLAG_Fortran)
set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")