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

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 14:58:49 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL248544: [CMake] Move LLD to the new style for symlink generation, and make the links… (authored by cbieneman).

Changed prior to commit:
  http://reviews.llvm.org/D13136?vs=35635&id=35677#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13136

Files:
  lld/trunk/tools/lld/CMakeLists.txt

Index: lld/trunk/tools/lld/CMakeLists.txt
===================================================================
--- lld/trunk/tools/lld/CMakeLists.txt
+++ lld/trunk/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.35677.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150924/10daf38a/attachment.bin>


More information about the llvm-commits mailing list