File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 1
1
2
2
cmake_minimum_required (VERSION 3.4.3 )
3
3
4
- list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR } /cmake/modules" )
4
+ list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR } /cmake/modules" )
5
5
6
6
project (dispatch
7
7
VERSION 1.3
@@ -30,6 +30,7 @@ include(CheckLibraryExists)
30
30
include (CheckSymbolExists )
31
31
include (GNUInstallDirs )
32
32
include (SwiftSupport )
33
+ include (DispatchUtilities )
33
34
34
35
set (SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript" )
35
36
set (INSTALL_LIBDIR "${SWIFT_LIBDIR} " CACHE PATH "Path where the libraries should be installed" )
Original file line number Diff line number Diff line change
1
+
2
+ function (dispatch_set_linker target )
3
+ if (USE_GOLD_LINKER )
4
+ set_property (TARGET ${target}
5
+ APPEND_STRING
6
+ PROPERTY LINK_FLAGS
7
+ -fuse-ld=gold )
8
+ endif ()
9
+ if (USE_LLD_LINKER )
10
+ set_property (TARGET ${target}
11
+ APPEND_STRING
12
+ PROPERTY LINK_FLAGS
13
+ -fuse-ld=lld )
14
+ endif ()
15
+ endfunction ()
Original file line number Diff line number Diff line change @@ -212,18 +212,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
212
212
"-Xlinker -dead_strip"
213
213
"-Xlinker -alias_list -Xlinker ${CMAKE_SOURCE_DIR} /xcodeconfig/libdispatch.aliases" )
214
214
endif ()
215
- if (USE_GOLD_LINKER )
216
- set_property (TARGET dispatch
217
- APPEND_STRING
218
- PROPERTY LINK_FLAGS
219
- -fuse-ld=gold )
220
- endif ()
221
- if (USE_LLD_LINKER )
222
- set_property (TARGET dispatch
223
- APPEND_STRING
224
- PROPERTY LINK_FLAGS
225
- -fuse-ld=lld )
226
- endif ()
215
+ dispatch_set_linker (dispatch )
227
216
228
217
# Temporary staging; the various swift projects that depend on libdispatch
229
218
# all expect libdispatch.so to be in src/.libs/libdispatch.so
You can’t perform that action at this time.
0 commit comments