Skip to content

Commit 07037a6

Browse files
authored
Merge pull request #37702 from lorentey/unittest-rpath
2 parents 23fcb49 + f3f8ade commit 07037a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ function(add_swift_unittest test_dirname)
4040
endif()
4141

4242
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
43-
# Add an @rpath to the swift library directory.
43+
# Add an @rpath to the swift library directory
44+
# and one to the OS dylibs we require but
45+
# are not building ourselves (e.g Foundation overlay)
4446
set_target_properties(${test_dirname} PROPERTIES
45-
BUILD_RPATH ${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx)
47+
BUILD_RPATH "${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx;${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
4648
# Force all the swift libraries to be found via rpath.
4749
add_custom_command(TARGET "${test_dirname}" POST_BUILD
4850
COMMAND "${SWIFT_SOURCE_DIR}/utils/swift-rpathize.py"
@@ -87,4 +89,3 @@ function(add_swift_unittest test_dirname)
8789
endif()
8890
endfunction()
8991

90-

0 commit comments

Comments
 (0)