Improve linker detection on macOS

This commit is contained in:
Robert Schulze 2023-09-29 17:14:11 +02:00
parent fe155c61d4
commit b90582f291
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A

View File

@ -49,14 +49,14 @@ endif ()
if (NOT LINKER_NAME)
if (COMPILER_CLANG)
if (OS_LINUX)
if (NOT ARCH_S390X) # s390x doesnt support lld
find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "ld.lld")
endif ()
if (OS_LINUX AND NOT ARCH_S390X)
find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "ld.lld")
elseif (OS_DARWIN)
find_program (LLD_PATH NAMES "ld")
endif ()
endif ()
if (OS_LINUX)
if (LLD_PATH)
if (LLD_PATH)
if (OS_LINUX OR OS_DARWIN)
if (COMPILER_CLANG)
# Clang driver simply allows full linker path.
set (LINKER_NAME ${LLD_PATH})