summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler/GNU.cmake')
-rw-r--r--Modules/Compiler/GNU.cmake5
1 files changed, 3 insertions, 2 deletions
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)