Skip to content

build: move the RPATH handling to the executables #29399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,6 @@ macro(add_sourcekit_executable name)
target_link_libraries(${name} PRIVATE ${LLVM_COMMON_LIBS})

set_target_properties(${name} PROPERTIES FOLDER "SourceKit executables")
if (NOT SWIFT_ASAN_BUILD)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set_target_properties(${name}
PROPERTIES
LINK_FLAGS "-Wl,-exported_symbol,_main")
endif()
if(SWIFT_ANALYZE_CODE_COVERAGE)
set_property(TARGET "${name}" APPEND_STRING PROPERTY
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
endif()
endif()
add_sourcekit_default_compiler_flags("${name}")
endmacro()

Expand Down
14 changes: 6 additions & 8 deletions tools/SourceKit/tools/complete-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
BlocksRuntime)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(complete-test
PROPERTIES
LINK_FLAGS "-Wl,-rpath -Wl,@executable_path/../lib")
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(complete-test PROPERTIES
INSTALL_RPATH "@executable_path/../lib")
target_link_options(complete-test PRIVATE
"LINKER:-exported_symbol,_main")
endif()

if(SWIFT_ANALYZE_CODE_COVERAGE)
set_property(TARGET complete-test APPEND_STRING PROPERTY
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
endif()

add_dependencies(tools complete-test)
swift_install_in_component(TARGETS complete-test
RUNTIME
DESTINATION bin
COMPONENT tools)
RUNTIME DESTINATION bin COMPONENT tools)
13 changes: 6 additions & 7 deletions tools/SourceKit/tools/sourcekitd-repl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ target_include_directories(sourcekitd-repl PRIVATE
target_link_libraries(sourcekitd-repl PRIVATE
${LibEdit_LIBRARIES})

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(sourcekitd-repl
PROPERTIES
LINK_FLAGS "-Wl,-rpath -Wl,@executable_path/../lib")
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(sourcekitd-repl PROPERTIES
INSTALL_RPATH "@executable_path/../lib")
target_link_options(sourcekitd-repl PRIVATE
"LINKER:-exported_symbol,_main")
endif()
if(SWIFT_ANALYZE_CODE_COVERAGE)
set_property(TARGET sourcekitd-repl APPEND_STRING PROPERTY
Expand All @@ -29,6 +30,4 @@ endif()

add_dependencies(tools sourcekitd-repl)
swift_install_in_component(TARGETS sourcekitd-repl
RUNTIME
DESTINATION bin
COMPONENT tools)
RUNTIME DESTINATION bin COMPONENT tools)
14 changes: 6 additions & 8 deletions tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ endif()

add_dependencies(sourcekitd-test sourcekitdTestOptionsTableGen)

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(sourcekitd-test
PROPERTIES
LINK_FLAGS "-Wl,-rpath -Wl,@executable_path/../lib")
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(sourcekitd-test PROPERTIES
INSTALL_RPATH "@executable_path/../lib")
target_link_options(sourcekitd-test PRIVATE
"LINKER:-exported_symbol,_main")
endif()

if(SWIFT_ANALYZE_CODE_COVERAGE)
set_property(TARGET sourcekitd-test APPEND_STRING PROPERTY
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
endif()

add_dependencies(tools sourcekitd-test)
swift_install_in_component(TARGETS sourcekitd-test
RUNTIME
DESTINATION bin
COMPONENT tools)
RUNTIME DESTINATION bin COMPONENT tools)