Skip to content

Commit

Permalink
[CMake] Move LLD to the new style for symlink generation, and make th…
Browse files Browse the repository at this point in the history
…e links list overridable.

Reviewers: lhames, rafael

Subscribers: llvm-commits

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

llvm-svn: 248544
  • Loading branch information
Chris Bieneman committed Sep 24, 2015
1 parent 590a48d commit 77456ef
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions lld/tools/lld/CMakeLists.txt
Expand Up @@ -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}\")

0 comments on commit 77456ef

Please sign in to comment.