[lld] r245266 - Create lld-link symlink on "make/ninja/whatever install".

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 21:24:46 PDT 2015


Author: ruiu
Date: Mon Aug 17 23:24:46 2015
New Revision: 245266

URL: http://llvm.org/viewvc/llvm-project?rev=245266&view=rev
Log:
Create lld-link symlink on "make/ninja/whatever install".

Added:
    lld/trunk/tools/lld/install_symlink.cmake
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=245266&r1=245265&r2=245266&view=diff
==============================================================================
--- lld/trunk/tools/lld/CMakeLists.txt (original)
+++ lld/trunk/tools/lld/CMakeLists.txt Mon Aug 17 23:24:46 2015
@@ -24,3 +24,5 @@ endif()
 set(dst "${LLVM_RUNTIME_OUTPUT_INTDIR}/lld-link${CMAKE_EXECUTABLE_SUFFIX}")
 add_custom_command(TARGET lld POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E ${command} ${src} ${dst})
+
+install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")

Added: lld/trunk/tools/lld/install_symlink.cmake
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/install_symlink.cmake?rev=245266&view=auto
==============================================================================
--- lld/trunk/tools/lld/install_symlink.cmake (added)
+++ lld/trunk/tools/lld/install_symlink.cmake Mon Aug 17 23:24:46 2015
@@ -0,0 +1,21 @@
+if(UNIX)
+  set(LINK_OR_COPY create_symlink)
+  set(DESTDIR $ENV{DESTDIR})
+else()
+  set(LINK_OR_COPY copy)
+endif()
+
+# CMAKE_EXECUTABLE_SUFFIX is undefined on cmake scripts. See PR9286.
+if(WIN32)
+  set(EXECUTABLE_SUFFIX ".exe")
+else()
+  set(EXECUTABLE_SUFFIX "")
+endif()
+
+set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/")
+
+message("Creating lld-link")
+
+execute_process(
+  COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "lld${EXECUTABLE_SUFFIX}" "lld-link${EXECUTABLE_SUFFIX}"
+  WORKING_DIRECTORY "${bindir}")




More information about the llvm-commits mailing list