diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f3f221e6..ab5d2abde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ include(CheckLibraryExists) include(CheckSymbolExists) include(GNUInstallDirs) include(SwiftSupport) -include(DispatchUtilities) set(SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript") set(INSTALL_LIBDIR "${SWIFT_LIBDIR}" CACHE PATH "Path where the libraries should be installed") @@ -83,18 +82,6 @@ option(ENABLE_DTRACE "enable dtrace support" "") option(ENABLE_TESTING "build libdispatch tests" ON) -option(USE_LLD_LINKER "use the lld linker" FALSE) - -if(NOT USE_LLD_LINKER AND - (CMAKE_SYSTEM_NAME STREQUAL Linux OR - CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR - CMAKE_SYSTEM_NAME STREQUAL Android)) - set(USE_GOLD_LINKER_DEFAULT TRUE) -else() - set(USE_GOLD_LINKER_DEFAULT FALSE) -endif() -option(USE_GOLD_LINKER "use the gold linker" ${USE_GOLD_LINKER_DEFAULT}) - option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Thread_local" ON) set(DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE}) diff --git a/cmake/modules/DispatchUtilities.cmake b/cmake/modules/DispatchUtilities.cmake deleted file mode 100644 index fea3622ec..000000000 --- a/cmake/modules/DispatchUtilities.cmake +++ /dev/null @@ -1,19 +0,0 @@ - -function(dispatch_set_linker target) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) - set(CMAKE_HOST_EXECUTABLE_SUFFIX .exe) - endif() - - if(USE_GOLD_LINKER) - set_property(TARGET ${target} - APPEND_STRING - PROPERTY LINK_FLAGS - -fuse-ld=gold${CMAKE_HOST_EXECUTABLE_SUFFIX}) - endif() - if(USE_LLD_LINKER) - set_property(TARGET ${target} - APPEND_STRING - PROPERTY LINK_FLAGS - -fuse-ld=lld${CMAKE_HOST_EXECUTABLE_SUFFIX}) - endif() -endfunction() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f71b68f45..9c4ae4c9c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -116,20 +116,6 @@ if(ENABLE_SWIFT) PROPERTIES POSITION_INDEPENDENT_CODE YES) - if(USE_LLD_LINKER) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) - set(use_ld_flag -use-ld=lld.exe) - else() - set(use_ld_flag -use-ld=lld) - endif() - elseif(USE_GOLD_LINKER) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) - set(use_ld_flag -use-ld=gold.exe) - else() - set(use_ld_flag -use-ld=gold) - endif() - endif() - add_swift_library(swiftDispatch CFLAGS -fblocks @@ -138,7 +124,6 @@ if(ENABLE_SWIFT) module-maps DispatchStubs LINK_FLAGS - ${use_ld_flag} -lDispatchStubs -L $ -lBlocksRuntime @@ -260,7 +245,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) "-Xlinker -dead_strip" "-Xlinker -alias_list -Xlinker ${PROJECT_SOURCE_DIR}/xcodeconfig/libdispatch.aliases") endif() -dispatch_set_linker(dispatch) install(TARGETS dispatch diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 11ab629a7..a27603559 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,7 +47,6 @@ endif () add_executable(bsdtestharness bsdtestharness.c) -dispatch_set_linker(bsdtestharness) target_include_directories(bsdtestharness PRIVATE ${CMAKE_CURRENT_BINARY_DIR} @@ -89,7 +88,6 @@ function(add_unit_test name) target_compile_options(${name} PRIVATE -fblocks) target_compile_options(${name} PRIVATE -Wall -Wno-deprecated-declarations) endif() - dispatch_set_linker(${name}) target_link_libraries(${name} PRIVATE dispatch