Don't try to guess linker on non-Linux builds

This commit is contained in:
Ivan Lezhankin 2020-03-13 18:20:25 +03:00
parent ff91b3f317
commit 0c757decbe

View File

@ -32,29 +32,29 @@ else ()
find_program (GOLD_PATH NAMES "ld.gold" "gold")
endif ()
if (NOT OS_FREEBSD)
# We prefer LLD linker over Gold or BFD.
if (NOT LINKER_NAME)
if (LLD_PATH)
if (COMPILER_GCC)
# GCC driver requires one of supported linker names like "lld".
set (LINKER_NAME "lld")
else ()
# Clang driver simply allows full linker path.
set (LINKER_NAME ${LLD_PATH})
if (OS_LINUX)
# We prefer LLD linker over Gold or BFD on Linux.
if (NOT LINKER_NAME)
if (LLD_PATH)
if (COMPILER_GCC)
# GCC driver requires one of supported linker names like "lld".
set (LINKER_NAME "lld")
else ()
# Clang driver simply allows full linker path.
set (LINKER_NAME ${LLD_PATH})
endif ()
endif ()
endif ()
endif ()
if (NOT LINKER_NAME)
if (GOLD_PATH)
if (COMPILER_GCC)
set (LINKER_NAME "gold")
else ()
set (LINKER_NAME ${GOLD_PATH})
if (NOT LINKER_NAME)
if (GOLD_PATH)
if (COMPILER_GCC)
set (LINKER_NAME "gold")
else ()
set (LINKER_NAME ${GOLD_PATH})
endif ()
endif ()
endif ()
endif ()
endif ()
if (LINKER_NAME)