Skip to content

Commit

Permalink
Use faster lld as the linker (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenraven committed Oct 29, 2021
1 parent 1837780 commit 8a70efd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld")

# Compile comamnds for clang tools
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -50,6 +51,7 @@ function(faabric_lib lib_name)
add_library(faabric::${lib_name} ALIAS ${lib_name})

if(BUILD_SHARED_LIBS)
target_link_options(${lib_name} PRIVATE "-fuse-ld=lld")
set_property(TARGET ${lib_name} PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET ${lib_name}_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
Expand Down Expand Up @@ -96,6 +98,10 @@ add_library(faabric
)
add_library(faabric::faabric ALIAS faabric)

if(BUILD_SHARED_LIBS)
target_link_options(faabric PRIVATE "-fuse-ld=lld")
endif()

target_link_libraries(faabric PUBLIC
faabric::faabricmpi
faabric::common_dependencies
Expand Down

0 comments on commit 8a70efd

Please sign in to comment.