build: delegate rpath handling to CMake

This moves the rpath handling to the build system rather than trying to
figure out the correct flags to pass to the driver.
This commit is contained in:
Saleem Abdulrasool
2020-01-25 12:38:24 -08:00
parent e26b21675d
commit 729ad36b80
4 changed files with 14 additions and 24 deletions

View File

@@ -15,14 +15,10 @@ target_link_libraries(swift-syntax-parser-test
libSwiftSyntaxParser
)
if(APPLE)
# Prioritize finding the parser library from the build/lib directory.
# Otherwise it may find it from the 'lib/swift/macosx' directory which could
# be out-of-date.
get_target_property(link_flags swift-syntax-parser-test LINK_FLAGS)
set(link_flags "-Xlinker -rpath -Xlinker @executable_path/../lib ${link_flags}")
set_property(TARGET swift-syntax-parser-test PROPERTY
LINK_FLAGS "${link_flags}")
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(swift-syntax-parser-test PROPERTIES
BUILD_WITH_INSTALL_RPATH YES
INSTALL_RPATH @executable_path/../lib)
endif()
set_property(TARGET swift-syntax-parser-test APPEND_STRING PROPERTY