Skip to content

Commit 4186d62

Browse files
committed
[CMake] Add lib to swift host libraries link directories
Our libraries have a `LC_LINKER_OPTION` for eg. `-lswiftLLVMJSON`. This is resolved (probably just based on the actual libswiftLLVMJSON.a added to the link command) by ld, but not by lld. Add in a link directory so that these libraries can be found.
1 parent b7a2fa2 commit 4186d62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,8 @@ function(add_swift_host_library name)
692692
693693
add_library(${name} ${libkind} ${ASHL_SOURCES})
694694
695+
target_link_directories(${name} PUBLIC ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
696+
695697
# Respect LLVM_COMMON_DEPENDS if it is set.
696698
#
697699
# LLVM_COMMON_DEPENDS if a global variable set in ./lib that provides targets

0 commit comments

Comments
 (0)