summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake9
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake5
2 files changed, 10 insertions, 4 deletions
diff --git a/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake b/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
index 596e1eb..f6d4a6c 100644
--- a/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
+++ b/Tests/RunCMake/BuildDepends/LinkDependsCheck.cmake
@@ -1,9 +1,12 @@
enable_language(C)
-file(WRITE "${CMAKE_BINARY_DIR}/LinkDependsUseLinker.cmake"
- "set(CMAKE_LINK_DEPENDS_USE_LINKER ${CMAKE_LINK_DEPENDS_USE_LINKER})
-set(CMAKE_C_LINK_DEPENDS_USE_LINKER ${CMAKE_C_LINK_DEPENDS_USE_LINKER})\n")
+file(WRITE "${CMAKE_BINARY_DIR}/LinkDependsUseLinker.cmake" "
+set(CMAKE_LINK_DEPENDS_USE_LINKER ${CMAKE_LINK_DEPENDS_USE_LINKER})
+set(CMAKE_C_LINK_DEPENDS_USE_LINKER ${CMAKE_C_LINK_DEPENDS_USE_LINKER})
+set(CMAKE_C_COMPILER_LINKER_ID ${CMAKE_C_COMPILER_LINKER_ID})
+set(CMAKE_C_COMPILER_LINKER_VERSION ${CMAKE_C_COMPILER_LINKER_VERSION})
+")
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake"
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index a585dce..5176f5b 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -208,7 +208,10 @@ if (RunCMake_GENERATOR MATCHES "Make|Ninja")
run_BuildDepends(LinkDependsCheck)
include("${RunCMake_BINARY_DIR}/LinkDependsCheck-build/LinkDependsUseLinker.cmake")
if ((NOT DEFINED CMAKE_LINK_DEPENDS_USE_LINKER OR CMAKE_LINK_DEPENDS_USE_LINKER)
- AND CMAKE_C_LINK_DEPENDS_USE_LINKER)
+ AND CMAKE_C_LINK_DEPENDS_USE_LINKER
+ # FIXME(#26401): GNU binutils 2.43 broke dependency-file generation.
+ AND NOT (CMAKE_C_COMPILER_LINKER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_LINKER_VERSION VERSION_GREATER_EQUAL "2.43")
+ )
run_BuildDepends(LinkDependsExternalLibrary)
unset(run_BuildDepends_skip_step_2)
run_BuildDepends(LinkDepends -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES})