[llvm] r272200 - [CMake] Support overriding binary install directory

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 09:28:26 PDT 2016


I’ve put a fix into clang in r272275. That should make this work for you. Please let me know if it doesn’t work.

Thanks,
-Chris

> On Jun 9, 2016, at 4:05 AM, Will Dietz <wdietz2 at illinois.edu> wrote:
> 
> Hi!
> 
> This change seems to have broken my ability to build clang out-of-tree, for reasons that seem to essentially come down to LLVM_TOOLS_INSTALL_DIR not being set, resulting in generation of install_symlink() commands with a missing third parameter.
> 
> I'd offer a patch but I'm not sure how to best address the issue, any ideas?
> 
> Looks like many properties are gathered from llvm-config when doing a standalone clang build[1], although I think for this we might be able to default to 'bin' unless user overrides it.
> 
> Anyway hopefully there's an easy answer, thanks for your time :)
> 
> ~Will
> 
> [1] https://github.com/llvm-mirror/clang/blob/1f6336d3adfb5ba2aa784f2e64cfb451d365abf2/CMakeLists.txt#L19 <https://github.com/llvm-mirror/clang/blob/1f6336d3adfb5ba2aa784f2e64cfb451d365abf2/CMakeLists.txt#L19>
> On Wed, Jun 8, 2016 at 4:26 PM Chris Bieneman via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: cbieneman
> Date: Wed Jun  8 16:19:26 2016
> New Revision: 272200
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=272200&view=rev <http://llvm.org/viewvc/llvm-project?rev=272200&view=rev>
> Log:
> [CMake] Support overriding binary install directory
> 
> This patch adds a new option LLVM_TOOLS_INSTALL_DIR which allows customizing the location executables and symlinks get installed to. This adds the functionality provided by autoconf's --bindir flag.
> 
> This patch is based on patches from and collaboration with Tony Kelman, and replaces http://reviews.llvm.org/D20934 <http://reviews.llvm.org/D20934>.
> 
> Modified:
>     llvm/trunk/CMakeLists.txt
>     llvm/trunk/cmake/modules/AddLLVM.cmake
>     llvm/trunk/cmake/modules/TableGen.cmake
> 
> Modified: llvm/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=272200&r1=272199&r2=272200&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=272200&r1=272199&r2=272200&view=diff>
> ==============================================================================
> --- llvm/trunk/CMakeLists.txt (original)
> +++ llvm/trunk/CMakeLists.txt Wed Jun  8 16:19:26 2016
> @@ -201,6 +201,9 @@ endif()
> 
>  set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
> 
> +set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
> +mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
> +
>  # They are used as destination of target generators.
>  set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
>  set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
> 
> Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=272200&r1=272199&r2=272200&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=272200&r1=272199&r2=272200&view=diff>
> ==============================================================================
> --- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
> +++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Jun  8 16:19:26 2016
> @@ -771,7 +771,7 @@ macro(add_llvm_tool name)
>      if( LLVM_BUILD_TOOLS )
>        install(TARGETS ${name}
>                EXPORT LLVMExports
> -              RUNTIME DESTINATION bin
> +              RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}
>                COMPONENT ${name})
> 
>        if (NOT CMAKE_CONFIGURATION_TYPES)
> @@ -1211,7 +1211,7 @@ function(llvm_install_symlink name dest)
>    set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX})
> 
>    install(SCRIPT ${INSTALL_SYMLINK}
> -          CODE "install_symlink(${full_name} ${full_dest} bin)"
> +          CODE "install_symlink(${full_name} ${full_dest} ${LLVM_TOOLS_INSTALL_DIR})"
>            COMPONENT ${component})
> 
>    if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE)
> 
> Modified: llvm/trunk/cmake/modules/TableGen.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=272200&r1=272199&r2=272200&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=272200&r1=272199&r2=272200&view=diff>
> ==============================================================================
> --- llvm/trunk/cmake/modules/TableGen.cmake (original)
> +++ llvm/trunk/cmake/modules/TableGen.cmake Wed Jun  8 16:19:26 2016
> @@ -141,7 +141,7 @@ macro(add_tablegen target project)
>    if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
>      install(TARGETS ${target}
>              EXPORT LLVMExports
> -            RUNTIME DESTINATION bin)
> +            RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
>    endif()
>    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
>  endmacro()
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160609/9c9bd888/attachment.html>


More information about the llvm-commits mailing list