Update tools.cmake

This commit is contained in:
alexey-milovidov 2019-12-10 23:14:57 +03:00 committed by GitHub
parent d7b276551c
commit c181fdc6a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,8 +27,13 @@ option (LINKER_NAME "Linker name or full path")
find_program (LLD_PATH NAMES "ld.lld" "lld" "lld-${COMPILER_VERSION_MAJOR}")
find_program (GOLD_PATH NAMES "ld.gold" "gold")
# We prefer LLD linker over Gold or BFD.
if (NOT LINKER_NAME)
if (LLD_PATH)
# GCC driver requires one of supported linker names like "lld".
# Clang driver simply allows full linker path.
if (COMPILER_GCC)
get_filename_component(LLD_BASE_NAME ${LLD_PATH} NAME)
if (LLD_BASE_NAME STREQUAL ld.lld)