[Driver] Create "link[.exe]" symlink for the Windows driver.

Clang creates "clang-cl" as a symlink to (or a copy of) "clang" for the MSVC-
compatible driver. This patch is to do the same thing for "link" and "lld".

Differential Revision: http://llvm-reviews.chandlerc.com/D3066

llvm-svn: 203751
This commit is contained in:
Rui Ueyama 2014-03-13 05:12:31 +00:00
parent 294607e122
commit f7ada499f1
1 changed files with 13 additions and 0 deletions

View File

@ -8,3 +8,16 @@ target_link_libraries(lld
install(TARGETS lld
RUNTIME DESTINATION bin)
# Create the link[.exe] symlink in the build directory. If symlink is not
# supported by the operating system, create a copy instead.
if(UNIX)
set(command create_symlink)
else()
set(command copy)
endif()
set(src "lld${CMAKE_EXECUTABLE_SUFFIX}")
set(dst "link${CMAKE_EXECUTABLE_SUFFIX}")
add_custom_command(TARGET lld POST_BUILD
COMMAND ${CMAKE_COMMAND} -E ${command} ${src} ${dst}
WORKING_DIRECTORY "${LLVM_RUNTIME_OUTPUT_INTDIR}")