[clang] [clang][CMake] Match "lld" only in the linker file name (PR #242747)
Graham Christensen via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 15 15:52:18 PST 2026
================
@@ -444,7 +444,8 @@ endif ()
# Determine HOST_LINK_VERSION on Darwin.
set(HOST_LINK_VERSION "" CACHE STRING "Host linker version on Darwin")
-if (APPLE AND NOT HOST_LINK_VERSION AND NOT CMAKE_LINKER MATCHES ".*lld.*")
+get_filename_component(CLANG_LINKER_NAME "${CMAKE_LINKER}" NAME)
+if (APPLE AND NOT HOST_LINK_VERSION AND NOT CLANG_LINKER_NAME MATCHES "lld")
get_darwin_linker_version(HOST_LINK_VERSION)
set(HOST_LINK_VERSION "${HOST_LINK_VERSION}" CACHE STRING "Host linker version on Darwin" FORCE)
endif()
----------------
grahamc wrote:
Great idea, I just added it!
https://github.com/llvm/llvm-project/pull/242747
More information about the cfe-commits
mailing list