From 0c757decbe390079321c7ff7731b279232bf962a Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Fri, 13 Mar 2020 18:20:25 +0300 Subject: [PATCH] Don't try to guess linker on non-Linux builds --- cmake/tools.cmake | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cmake/tools.cmake b/cmake/tools.cmake index 6aaeb5b8a16..8eccbfd9f83 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -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)