File tree Expand file tree Collapse file tree 4 files changed +14
-24
lines changed
tools/swift-syntax-parser-test Expand file tree Collapse file tree 4 files changed +14
-24
lines changed Original file line number Diff line number Diff line change @@ -2583,12 +2583,6 @@ function(_add_swift_executable_single name)
2583
2583
LINK_LIBRARIES_VAR_NAME link_libraries
2584
2584
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories )
2585
2585
2586
- if (${SWIFTEXE_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS )
2587
- list (APPEND link_flags
2588
- "-Xlinker" "-rpath"
2589
- "-Xlinker" "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}" )
2590
- endif ()
2591
-
2592
2586
_list_add_string_suffix (
2593
2587
"${SWIFTEXE_SINGLE_LINK_LIBRARIES} "
2594
2588
"-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}-${SWIFTEXE_SINGLE_ARCHITECTURE} "
@@ -2637,6 +2631,11 @@ function(_add_swift_executable_single name)
2637
2631
if (SWIFT_PARALLEL_LINK_JOBS )
2638
2632
set_property (TARGET ${name} PROPERTY JOB_POOL_LINK swift_link_job_pool )
2639
2633
endif ()
2634
+ if (${SWIFTEXE_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS )
2635
+ set_target_properties (${name} PROPERTIES
2636
+ BUILD_WITH_INSTALL_RPATH YES
2637
+ INSTALL_RPATH "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK} _LIB_SUBDIR}" )
2638
+ endif ()
2640
2639
set_output_directory (${name}
2641
2640
BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
2642
2641
LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR} )
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ function(add_swift_unittest test_dirname)
40
40
endif ()
41
41
42
42
if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
43
- set_property ( TARGET " ${test_dirname} " APPEND_STRING PROPERTY
44
- LINK_FLAGS " -Xlinker -rpath -Xlinker ${SWIFT_LIBRARY_OUTPUT_INTDIR} /swift/macosx" )
43
+ set_target_properties ( ${test_dirname} PROPERTIES
44
+ BUILD_RPATH ${SWIFT_LIBRARY_OUTPUT_INTDIR} /swift/macosx )
45
45
elseif ("${SWIFT_HOST_VARIANT} " STREQUAL "android" )
46
46
swift_android_lib_for_arch (${SWIFT_HOST_VARIANT_ARCH} android_system_libs )
47
47
set_property (TARGET "${test_dirname} " APPEND PROPERTY LINK_DIRECTORIES
Original file line number Diff line number Diff line change @@ -15,14 +15,10 @@ target_link_libraries(swift-syntax-parser-test
15
15
libSwiftSyntaxParser
16
16
)
17
17
18
- if (APPLE )
19
- # Prioritize finding the parser library from the build/lib directory.
20
- # Otherwise it may find it from the 'lib/swift/macosx' directory which could
21
- # be out-of-date.
22
- get_target_property (link_flags swift-syntax-parser-test LINK_FLAGS )
23
- set (link_flags "-Xlinker -rpath -Xlinker @executable_path/../lib ${link_flags} " )
24
- set_property (TARGET swift-syntax-parser-test PROPERTY
25
- LINK_FLAGS "${link_flags} " )
18
+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
19
+ set_target_properties (swift-syntax-parser-test PROPERTIES
20
+ BUILD_WITH_INSTALL_RPATH YES
21
+ INSTALL_RPATH @executable_path/../lib )
26
22
endif ()
27
23
28
24
set_property (TARGET swift-syntax-parser-test APPEND_STRING PROPERTY
Original file line number Diff line number Diff line change @@ -12,14 +12,9 @@ target_link_libraries(SwiftSyntaxParserTests
12
12
PRIVATE
13
13
libSwiftSyntaxParser )
14
14
15
- if (APPLE )
16
- # Prioritize finding the parser library from the build/lib directory.
17
- # Otherwise it may find it from the 'lib/swift/macosx' directory which could
18
- # be out-of-date.
19
- get_target_property (link_flags SwiftSyntaxParserTests LINK_FLAGS )
20
- set (link_flags "-Xlinker -rpath -Xlinker ${SWIFT_LIBRARY_OUTPUT_INTDIR} ${link_flags} " )
21
- set_property (TARGET SwiftSyntaxParserTests PROPERTY
22
- LINK_FLAGS "${link_flags} " )
15
+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin )
16
+ set_target_properties (SwiftSyntaxParserTests PROPERTIES
17
+ BUILD_RPATH ${SWIFT_LIBRARY_OUTPUT_INTDIR} )
23
18
endif ()
24
19
25
20
set_property (TARGET SwiftSyntaxParserTests APPEND_STRING PROPERTY
You can’t perform that action at this time.
0 commit comments