[llvm] r223655 - [CMake] Fix installation of llvm-ranlib on multiconfig builder.
Rafael EspĂndola
rafael.espindola at gmail.com
Mon Dec 8 10:00:38 PST 2014
Thanks!
On 8 December 2014 at 08:43, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> Author: chapuni
> Date: Mon Dec 8 07:43:38 2014
> New Revision: 223655
>
> URL: http://llvm.org/viewvc/llvm-project?rev=223655&view=rev
> Log:
> [CMake] Fix installation of llvm-ranlib on multiconfig builder.
>
> Introduce install_symlink.cmake from clang/tools/driver/clang_symlink.cmake.
>
> FIXME: Would it be generalized?
>
> Added:
> llvm/trunk/tools/llvm-ar/install_symlink.cmake
> Modified:
> llvm/trunk/tools/llvm-ar/CMakeLists.txt
>
> Modified: llvm/trunk/tools/llvm-ar/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/CMakeLists.txt?rev=223655&r1=223654&r2=223655&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-ar/CMakeLists.txt (original)
> +++ llvm/trunk/tools/llvm-ar/CMakeLists.txt Mon Dec 8 07:43:38 2014
> @@ -24,4 +24,4 @@ add_custom_command(OUTPUT ${llvm_ranlib}
> DEPENDS llvm-ar)
>
> add_custom_target(llvm-ranlib ALL DEPENDS ${llvm_ranlib})
> -install(FILES "${llvm_ranlib}" DESTINATION bin)
> +install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
>
> Added: llvm/trunk/tools/llvm-ar/install_symlink.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/install_symlink.cmake?rev=223655&view=auto
> ==============================================================================
> --- llvm/trunk/tools/llvm-ar/install_symlink.cmake (added)
> +++ llvm/trunk/tools/llvm-ar/install_symlink.cmake Mon Dec 8 07:43:38 2014
> @@ -0,0 +1,25 @@
> +# We need to execute this script at installation time because the
> +# DESTDIR environment variable may be unset at configuration time.
> +# See PR8397.
> +
> +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 llvm-ranlib")
> +
> +execute_process(
> + COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "llvm-ar${EXECUTABLE_SUFFIX}" "llvm-ranlib${EXECUTABLE_SUFFIX}"
> + WORKING_DIRECTORY "${bindir}")
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list