commit d2bf9fd: [Minor] Do not use lld when clang is not the compiler...

Vsevolod Stakhov vsevolod at rspamd.com
Sun Jul 16 21:14:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-07-16 22:09:46 +0100
URL: https://github.com/rspamd/rspamd/commit/d2bf9fd226253e32d1d70f7ad379fcbb2ccb6d61 (HEAD -> master)

[Minor] Do not use lld when clang is not the compiler...

---
 cmake/Toolset.cmake | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/cmake/Toolset.cmake b/cmake/Toolset.cmake
index fc019cf35..dfd1d3008 100644
--- a/cmake/Toolset.cmake
+++ b/cmake/Toolset.cmake
@@ -78,7 +78,15 @@ find_program(GOLD_PATH NAMES "ld.gold" "gold")
 
 if(NOT LINKER_NAME)
     if(LLD_PATH)
-        set(LINKER_NAME "lld")
+        if (COMPILER_CLANG)
+            set(LINKER_NAME "lld")
+        else()
+            if(GOLD_PATH)
+                set(LINKER_NAME "gold")
+            else()
+                message(STATUS "Use generic 'ld' as a linker")
+            endif()
+        endif()
     elseif(GOLD_PATH)
         set(LINKER_NAME "gold")
     else()


More information about the Commits mailing list