Skip to content

Commit 2706d53

Browse files
committed
build: prefer lld over gold
lld is the LLVM linker which is faster than gold. Prefer lld over gold (that is, if `-DUSE_LLD_LINKER` is provided, gold will not be used).
1 parent 5be8669 commit 2706d53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,18 @@ option(BUILD_SHARED_LIBS "build shared libraries" ON)
9191

9292
option(ENABLE_TESTING "build libdispatch tests" ON)
9393

94+
option(USE_LLD_LINKER "use the lld linker" OFF)
95+
9496
if(CMAKE_SYSTEM_NAME STREQUAL Linux OR
9597
CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR
96-
CMAKE_SYSTEM_NAME STREQUAL Android)
98+
CMAKE_SYSTEM_NAME STREQUAL Android AND
99+
NOT USE_LLD_LINKER)
97100
set(USE_GOLD_LINKER_DEFAULT ON)
98101
else()
99102
set(USE_GOLD_LINKER_DEFAULT OFF)
100103
endif()
101104
option(USE_GOLD_LINKER "use the gold linker" ${USE_GOLD_LINKER_DEFAULT})
102105

103-
option(USE_LLD_LINKER "use the lld linker" OFF)
104-
105106
option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Thread_local" ON)
106107
set(DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE})
107108

0 commit comments

Comments
 (0)