From 3c4c910e7b2c1c1de7325d9c6c450b0ec050c1c9 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 3 Dec 2016 14:27:55 -0800 Subject: [PATCH] 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. --- cmake/modules/AddSwift.cmake | 5 +++++ tools/driver/CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake index 56b45e92b4b36..052213d35d908 100644 --- a/cmake/modules/AddSwift.cmake +++ b/cmake/modules/AddSwift.cmake @@ -2124,3 +2124,8 @@ function(add_swift_host_tool executable) endif() 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() diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index ef4fd1ce935f3..cd9f779ae9c4c 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -31,6 +31,10 @@ swift_create_post_build_symlink(swift DESTINATION "swift-autolink-extract${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") +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) add_dependencies(swift clang-headers)