Skip to content

Commit 61c14d1

Browse files
committed
Use target_link_libraries for fat executable dependencies
These were getting added to the link command line manually, which can cause coincidental library ordering issues.
1 parent 5ea5bb0 commit 61c14d1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cmake/modules/AddSwift.cmake

+1-5
Original file line numberDiff line numberDiff line change
@@ -1754,10 +1754,6 @@ function(_add_swift_executable_single name)
17541754
list(APPEND link_flags
17551755
"-L${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
17561756

1757-
foreach(FAT_LIBRARY ${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES})
1758-
list(APPEND link_flags "-l${FAT_LIBRARY}")
1759-
endforeach()
1760-
17611757
if(SWIFTEXE_SINGLE_DISABLE_ASLR)
17621758
list(APPEND link_flags "-Wl,-no_pie")
17631759
endif()
@@ -1830,7 +1826,7 @@ function(_add_swift_executable_single name)
18301826
PROPERTIES
18311827
HEADER_FILE_ONLY true)
18321828

1833-
target_link_libraries("${name}" ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
1829+
target_link_libraries("${name}" ${SWIFTEXE_SINGLE_LINK_LIBRARIES} ${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES})
18341830
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_COMPONENT_DEPENDS})
18351831

18361832
set_target_properties(${name}

0 commit comments

Comments
 (0)