summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Clang-HIP.cmake8
-rw-r--r--Modules/Compiler/GNU.cmake5
2 files changed, 3 insertions, 10 deletions
diff --git a/Modules/Compiler/Clang-HIP.cmake b/Modules/Compiler/Clang-HIP.cmake
index 7e3c99c..92925f1 100644
--- a/Modules/Compiler/Clang-HIP.cmake
+++ b/Modules/Compiler/Clang-HIP.cmake
@@ -1,13 +1,5 @@
include(Compiler/Clang)
-#
-# For now, deactivate globally linker dependency file support because
-# HIP compiler is based on Clang which provides support of other languages
-#
-foreach (lang IN ITEMS "C" "CXX" "OBJC" "OBJCXX" "Fortran" "ASM")
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
-endforeach()
-
__compiler_clang(HIP)
__compiler_clang_cxx_standards(HIP)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index f140208..251e05a 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -53,7 +53,7 @@ macro(__compiler_gnu lang)
endif()
# define flags for linker depfile generation
- if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
+ if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
## Ensure ninja tool is recent enough...
if(CMAKE_GENERATOR MATCHES "^Ninja")
# Ninja 1.10 or upper is required
@@ -71,7 +71,7 @@ macro(__compiler_gnu lang)
if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
## check if this feature is supported by the linker
- execute_process(COMMAND "${CMAKE_LINKER}" --help
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -Wl,--help
OUTPUT_VARIABLE _linker_capabilities
ERROR_VARIABLE _linker_capabilities)
if(_linker_capabilities MATCHES "--dependency-file")
@@ -82,6 +82,7 @@ macro(__compiler_gnu lang)
unset(_linker_capabilities)
endif()
endif()
+
if (CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,<DEP_FILE>")
set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc)