summaryrefslogtreecommitdiffstats
path: root/lld/tools
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-03-13 05:12:31 +0000
committerRui Ueyama <ruiu@google.com>2014-03-13 05:12:31 +0000
commitf7ada499f1c6daaf0dd8072a1ec7da49f397fa6a (patch)
tree3d3ec849bcf4299335f63e6f9f97fe49ba30137c /lld/tools
parent294607e122b32ba71e1c0639b54b2f5a1f217072 (diff)
downloadbcm5719-llvm-f7ada499f1c6daaf0dd8072a1ec7da49f397fa6a.tar.gz
bcm5719-llvm-f7ada499f1c6daaf0dd8072a1ec7da49f397fa6a.zip
[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
Diffstat (limited to 'lld/tools')
-rw-r--r--lld/tools/lld/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index d6a2b1cc64e..eb5e6ac2789 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -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}")
OpenPOWER on IntegriCloud