add_lld_executable(lld
  lld.cpp
  )

target_link_libraries(lld
  lldDriver
  )

install(TARGETS lld
  RUNTIME DESTINATION bin)

add_lld_executable(lld
  lld.cpp
  )

target_link_libraries(lld
  lldDriver
  )

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}")

Create "link[.exe]" symlink for the Windows driver.
[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

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@203751 91177308-0d34-0410-b5e6-96231b3b80d8
