File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ set(SWIFT_COMPILER_VERSION "" CACHE STRING
110
110
set (CLANG_COMPILER_VERSION "" CACHE STRING
111
111
"The internal version of the Clang compiler" )
112
112
113
+ # Indicate whether Swift should attempt to use the lld linker.
114
+ set (SWIFT_ENABLE_LLD_LINKER FALSE CACHE BOOL
115
+ "Enable using the lld linker when available" )
116
+
113
117
# Indicate whether Swift should attempt to use the gold linker.
114
118
# This is not used on Darwin.
115
119
set (SWIFT_ENABLE_GOLD_LINKER FALSE CACHE BOOL
Original file line number Diff line number Diff line change @@ -888,6 +888,9 @@ function(_add_swift_library_single target name)
888
888
"${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "ELF" )
889
889
list (APPEND link_flags "-fuse-ld=gold" )
890
890
endif ()
891
+ if (SWIFT_ENABLE_LLD_LINKER )
892
+ list (APPEND link_flags "-fuse-ld=lld" )
893
+ endif ()
891
894
892
895
# Configure plist creation for OS X.
893
896
set (PLIST_INFO_PLIST "Info.plist" CACHE STRING "Plist name" )
@@ -1530,6 +1533,9 @@ function(_add_swift_executable_single name)
1530
1533
"${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _OBJECT_FORMAT}" STREQUAL "ELF" )
1531
1534
list (APPEND link_flags "-fuse-ld=gold" )
1532
1535
endif ()
1536
+ if (SWIFT_ENABLE_LLD_LINKER )
1537
+ list (APPEND link_flags "-fuse-ld=lld" )
1538
+ endif ()
1533
1539
1534
1540
# Find the names of dependency library targets.
1535
1541
#
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ function(add_swift_unittest test_dirname)
54
54
set_property (TARGET "${test_dirname} " APPEND_STRING PROPERTY
55
55
LINK_FLAGS " -fuse-ld=gold" )
56
56
endif ()
57
+ if (SWIFT_ENABLE_LLD_LINKER )
58
+ set_property (TARGET "${test_dirname} " APPEND_STRING PROPERTY
59
+ LINK_FLAGS " -fuse-ld=lld" )
60
+ endif ()
57
61
endfunction ()
58
62
59
63
You can’t perform that action at this time.
0 commit comments