[PATCH] D13136: [CMake] Move LLD to the new style for symlink generation, and make the links list overridable.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 09:03:46 PDT 2015


beanz created this revision.
beanz added reviewers: lhames, rafael.
beanz added a subscriber: llvm-commits.

http://reviews.llvm.org/D13136

Files:
  tools/lld/CMakeLists.txt

Index: tools/lld/CMakeLists.txt
===================================================================
--- tools/lld/CMakeLists.txt
+++ tools/lld/CMakeLists.txt
@@ -11,18 +11,13 @@
 install(TARGETS lld
   RUNTIME DESTINATION bin)
 
-if(UNIX)
-  set(LLD_LINK_OR_COPY create_symlink)
-  set(lld_binary "lld${CMAKE_EXECUTABLE_SUFFIX}")
-
-else()
-  set(LLD_LINK_OR_COPY copy)
-  set(lld_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/lld${CMAKE_EXECUTABLE_SUFFIX}")
+if(NOT LLD_SYMLINKS_TO_CREATE)
+  set(LLD_SYMLINKS_TO_CREATE lld-link)
 endif()
 
-set(lld_link "${LLVM_RUNTIME_OUTPUT_INTDIR}/lld-link${CMAKE_EXECUTABLE_SUFFIX}")
-
-add_custom_command(TARGET lld POST_BUILD
-                   COMMAND ${CMAKE_COMMAND} -E ${LLD_LINK_OR_COPY} "${lld_binary}" "${lld_link}")
+foreach(link ${LLD_SYMLINKS_TO_CREATE})
+  add_llvm_tool_symlink(${link} lld ALWAYS_GENERATE)
+  # Always generate install targets
+  llvm_install_symlink(${link} lld ALWAYS_GENERATE)
+endforeach()
 
-install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13136.35635.patch
Type: text/x-patch
Size: 1050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150924/d893b884/attachment.bin>


More information about the llvm-commits mailing list