Skip to content

Commit 3c4c910

Browse files
compnerdCodaFi
authored andcommitted
build: create and use a wrapper for add_llvm_tool_symlink
Introduce a new function `add_swift_tool_symlink`. Use this instead of the `add_llvm_tool_symlink` and `install_in_swift_component`. This mimics the behaviour in clang as well as the general pattern of renaming the functions from the LLVM build infrastructure.
1 parent 49b31fe commit 3c4c910

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,3 +2124,8 @@ function(add_swift_host_tool executable)
21242124
endif()
21252125
endif()
21262126
endfunction()
2127+
2128+
macro(add_swift_tool_symlink name dest component)
2129+
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
2130+
llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE COMPONENT ${component})
2131+
endmacro()

tools/driver/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ swift_create_post_build_symlink(swift
3131
DESTINATION "swift-autolink-extract${CMAKE_EXECUTABLE_SUFFIX}"
3232
WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
3333

34+
add_swift_tool_symlink(swiftc swift compiler)
35+
add_swift_tool_symlink(swift-autolink-extract swift autolink-driver)
36+
add_swift_tool_symlink(swift-format swift editor-integration)
37+
3438
# If building as part of clang, make sure the headers are installed.
3539
if(NOT SWIFT_BUILT_STANDALONE)
3640
add_dependencies(swift clang-headers)

0 commit comments

Comments
 (0)