summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-11-28 15:01:26 (GMT)
committerBrad King <brad.king@kitware.com>2024-11-28 15:07:52 (GMT)
commitf4e74af1ea6384692d4cd41be5e94426c3e40210 (patch)
tree1fa102427fc8b7417ee521ebef7a61b4d334847e
parent75b3cc67c91542c3c54f97a5c90022c7cebbc925 (diff)
downloadCMake-f4e74af1ea6384692d4cd41be5e94426c3e40210.zip
CMake-f4e74af1ea6384692d4cd41be5e94426c3e40210.tar.gz
CMake-f4e74af1ea6384692d4cd41be5e94426c3e40210.tar.bz2
GNU linker: Use single-argument form of --dependency-file flag
The GNU `ld(1)` manual documents the `--dependency-file=depfile` single-argument form of the flag. Prefer it over the multi-argument `--dependency-file depfile` form so that only one argument needs to be passed through the compiler driver by `-Wl,` or equivalent. This may improve diagnostics in cases where it is unsupported, making them easier to diagnose. Issue: #26483
-rw-r--r--Modules/Linker/GNU.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/Linker/GNU.cmake b/Modules/Linker/GNU.cmake
index ca3457a..978ac12 100644
--- a/Modules/Linker/GNU.cmake
+++ b/Modules/Linker/GNU.cmake
@@ -11,7 +11,7 @@ cmake_policy(SET CMP0140 NEW)
function(__linker_gnu lang)
# define flags for linker depfile generation
- set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,<DEP_FILE>")
+ set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file=<DEP_FILE>")
set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc)
if(NOT CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")