Skip to content

build: create and use a wrapper for add_llvm_tool_symlink #6053

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2032,3 +2032,8 @@ function(add_swift_host_tool executable)
RUNTIME DESTINATION bin)
endif()
endfunction()

macro(add_swift_tool_symlink name dest component)
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE COMPONENT ${component})
endmacro()
15 changes: 3 additions & 12 deletions tools/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ add_swift_host_tool(swift

target_link_libraries(swift edit)

add_llvm_tool_symlink(swiftc swift ALWAYS_GENERATE)
add_llvm_tool_symlink(swift-autolink-extract swift ALWAYS_GENERATE)
add_llvm_tool_symlink(swift-format swift ALWAYS_GENERATE)
add_swift_tool_symlink(swiftc swift compiler)
add_swift_tool_symlink(swift-autolink-extract swift autolink-driver)
add_swift_tool_symlink(swift-format swift editor-integration)

# If building as part of clang, make sure the headers are installed.
if(NOT SWIFT_BUILT_STANDALONE)
Expand All @@ -38,12 +38,3 @@ if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
LINK_FLAGS " -lobjc -Wl,-force_load,\"${SWIFT_REPL_ARCLITE}\"")
endif()

swift_install_in_component(compiler
FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swiftc"
DESTINATION "bin")
swift_install_in_component(autolink-driver
FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-autolink-extract"
DESTINATION "bin")
swift_install_in_component(editor-integration
FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-format"
DESTINATION "bin")