summaryrefslogtreecommitdiff
path: root/Modules/CMakeHIPInformation.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-07-02 10:47:32 +0200
committerMarc Chevrier <marc.chevrier@gmail.com>2021-07-09 14:50:50 +0200
commit14e57e9637964594461711954c6c906bc22eb7c7 (patch)
tree7e6bbfb2303d1c4377470180a36a6103df1a55fb /Modules/CMakeHIPInformation.cmake
parent9c5132a586562c00511fd8ff2bac0250c70dae95 (diff)
downloadcmake-14e57e9637964594461711954c6c906bc22eb7c7.tar.gz
LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property LINK_WHAT_YOU_USE will be ignored for other plateforms. Moreover, flags and commands are now controled by CMake variables. Fixes: #20174
Diffstat (limited to 'Modules/CMakeHIPInformation.cmake')
-rw-r--r--Modules/CMakeHIPInformation.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index ec37e1c91a..9862f247fc 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -68,6 +68,15 @@ if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS})
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_HIP_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()
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time