[lld] r248544 - [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 14:53:19 PDT 2015


Author: cbieneman
Date: Thu Sep 24 16:53:18 2015
New Revision: 248544

URL: http://llvm.org/viewvc/llvm-project?rev=248544&view=rev
Log:
[CMake] Move LLD to the new style for symlink generation, and make the links list overridable.

Reviewers: lhames, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13136

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

Modified: lld/trunk/tools/lld/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/CMakeLists.txt?rev=248544&r1=248543&r2=248544&view=diff
==============================================================================
--- lld/trunk/tools/lld/CMakeLists.txt (original)
+++ lld/trunk/tools/lld/CMakeLists.txt Thu Sep 24 16:53:18 2015
@@ -11,18 +11,13 @@ target_link_libraries(lld
 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}\")




More information about the llvm-commits mailing list