summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-26 13:43:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-26 13:43:55 (GMT)
commit529b818378843c8c3c6da807a79c1496c1acdb9a (patch)
tree7cbcf43e4a99d0e7e144a0960861dbe3ad797e59 /Modules
parentf58c7659d8652c1172fc15a0bae9d71ee477c1eb (diff)
parent5945a98ced2e1f4794f26f39256c95d875220408 (diff)
downloadCMake-529b818378843c8c3c6da807a79c1496c1acdb9a.zip
CMake-529b818378843c8c3c6da807a79c1496c1acdb9a.tar.gz
CMake-529b818378843c8c3c6da807a79c1496c1acdb9a.tar.bz2
Merge topic 'link-depends-is-OFF' into release-3.27
5945a98ced link dependencies: deactivate the feature Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8587
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/GNU.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 251e05a..d01054b 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -53,6 +53,9 @@ macro(__compiler_gnu lang)
endif()
# define flags for linker depfile generation
+ set(CMAKE_${lang}_LINKER_DEPFILE_FLAGS "LINKER:--dependency-file,<DEP_FILE>")
+ set(CMAKE_${lang}_LINKER_DEPFILE_FORMAT gcc)
+
if(NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
## Ensure ninja tool is recent enough...
if(CMAKE_GENERATOR MATCHES "^Ninja")
@@ -82,15 +85,19 @@ 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)
set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER TRUE)
else()
unset(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER)
endif()
+ # For now, due to GNU binutils ld bug when LTO is enabled (see GNU bug
+ # `30568 <https://sourceware.org/bugzilla/show_bug.cgi?id=30568>`_),
+ # deactivate this feature.
+ if (NOT DEFINED CMAKE_LINK_DEPENDS_USE_LINKER)
+ set(CMAKE_LINK_DEPENDS_USE_LINKER FALSE)
+ endif()
+
# Initial configuration flags.
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")