forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request JuliaLang#14863 from JuliaLang/tk/usrbin
RFC: Segregate binaries created by deps out of usr/bin
- Loading branch information
Showing
18 changed files
with
283 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b8a2f6b0e68bef46e53da2ac439e1cf4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
51066066ff2c12ed2198605ecf68846b0c96b548adafa5b80e0c786d0df488411a5e8973358fce7192dc977ad4e68414cf14500e3c39746de62465eb145bb819 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3c265508526760f233620f35d79c79fc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
715db21156e6bd91cfa626f5201b32a6619e51532f5635ef52396da8193738ba66113485b61cc1e218b16737e66f72cc2e4bb3a7a33e73061ac2ef2c6330a299 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
commit f4dd81db3c617f22881446eb0ed6bfdc7d69e81e | ||
Author: Chris Bieneman <[email protected]> | ||
Date: Mon Sep 14 23:09:06 2015 +0000 | ||
|
||
[CMake] Refactor and cleanup generating and installing symlinks to tools. | ||
|
||
Summary: This change generalizes symlink generation and makes symlinks to tools obey LLVM_TOOLCHAIN_TOOLS. It makes it so that if you exclude llvm-ar from LLVM_TOOLCHAIN_TOOLS you don't end up with broken symlinks to llvm-lib and llvm-ranlib in your install. | ||
|
||
Reviewers: bogner, chapuni, rafael | ||
|
||
Subscribers: llvm-commits | ||
|
||
Differential Revision: http://reviews.llvm.org/D12864 | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247632 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit 2ec309f7d116b6f10cf7dc4ca481aa69ddbe1e5b) | ||
|
||
Conflicts: | ||
cmake/modules/AddLLVM.cmake | ||
|
||
[CMake] Rename target->dest as per feedback from Chapuni on http://reviews.llvm.org/D12864 | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247658 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit 5d1cac1aa28e02fda6be52b5ddf4940085df64d9) | ||
|
||
[CMake] More refactoring of symlink creation. | ||
|
||
This refactoring is to enable clang to re-use this code. | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247850 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit 2334ac1e4cc684bf1f68ac47b4486cf5d4dc8528) | ||
|
||
[CMake] More cleanup of installing symlinks. | ||
|
||
In order to support building clang out-of-tree the install_symlink script needs to be installed, and it needs to be found by searching the CMAKE_MODULE_PATH. | ||
|
||
This change renames install_symlink -> LLVMInstallSymlink so it doesn't conflict with naming from other projects, and adds searching behavior in AddLLVM.cmake | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248009 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit f8d6e92d57aacf9388e8ed87cc43b22bd3367c4f) | ||
|
||
[CMake] Adding ALWAYS_GENERATE option to symlink utility functions. | ||
|
||
This implements the behavior required for clang symlinks which should be always generated. | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248039 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit 907451c6d653f5d0f4efa55fb42a84dae67a37cc) | ||
|
||
[CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too. | ||
|
||
In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable. | ||
|
||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250573 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
(cherry picked from commit 26751e15750dbb733946c940e8a3bdfc5c446d8e) | ||
|
||
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake | ||
index 45f6746..7f711ce 100644 | ||
--- a/cmake/modules/AddLLVM.cmake | ||
+++ b/cmake/modules/AddLLVM.cmake | ||
@@ -602,9 +602,10 @@ function(export_executable_symbols target) | ||
endif() | ||
endfunction() | ||
|
||
- | ||
set (LLVM_TOOLCHAIN_TOOLS | ||
llvm-ar | ||
+ llvm-ranlib | ||
+ llvm-lib | ||
llvm-objdump | ||
) | ||
|
||
@@ -939,3 +940,77 @@ function(add_lit_testsuites project directory) | ||
endforeach() | ||
endif() | ||
endfunction() | ||
+ | ||
+function(llvm_install_symlink name dest) | ||
+ cmake_parse_arguments(ARG "ALWAYS_GENERATE" "" "" ${ARGN}) | ||
+ foreach(path ${CMAKE_MODULE_PATH}) | ||
+ if(EXISTS ${path}/LLVMInstallSymlink.cmake) | ||
+ set(INSTALL_SYMLINK ${path}/LLVMInstallSymlink.cmake) | ||
+ break() | ||
+ endif() | ||
+ endforeach() | ||
+ | ||
+ if(ARG_ALWAYS_GENERATE) | ||
+ set(component ${dest}) | ||
+ else() | ||
+ set(component ${name}) | ||
+ endif() | ||
+ | ||
+ set(full_name ${name}${CMAKE_EXECUTABLE_SUFFIX}) | ||
+ set(full_dest ${dest}${CMAKE_EXECUTABLE_SUFFIX}) | ||
+ | ||
+ install(SCRIPT ${INSTALL_SYMLINK} | ||
+ CODE "install_symlink(${full_name} ${full_dest} bin)" | ||
+ COMPONENT ${component}) | ||
+ | ||
+ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT ARG_ALWAYS_GENERATE) | ||
+ add_custom_target(install-${name} | ||
+ DEPENDS ${name} ${dest} install-${dest} | ||
+ COMMAND "${CMAKE_COMMAND}" | ||
+ -DCMAKE_INSTALL_COMPONENT=${name} | ||
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") | ||
+ endif() | ||
+endfunction() | ||
+ | ||
+function(add_llvm_tool_symlink name dest) | ||
+ cmake_parse_arguments(ARG "ALWAYS_GENERATE" "" "" ${ARGN}) | ||
+ if(UNIX) | ||
+ set(LLVM_LINK_OR_COPY create_symlink) | ||
+ set(dest_binary "${dest}${CMAKE_EXECUTABLE_SUFFIX}") | ||
+ else() | ||
+ set(LLVM_LINK_OR_COPY copy) | ||
+ set(dest_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/${dest}${CMAKE_EXECUTABLE_SUFFIX}") | ||
+ endif() | ||
+ | ||
+ set(output_path "${LLVM_RUNTIME_OUTPUT_INTDIR}/${name}${CMAKE_EXECUTABLE_SUFFIX}") | ||
+ | ||
+ if(ARG_ALWAYS_GENERATE) | ||
+ set_property(DIRECTORY APPEND PROPERTY | ||
+ ADDITIONAL_MAKE_CLEAN_FILES ${dest_binary}) | ||
+ add_custom_command(TARGET ${dest} POST_BUILD | ||
+ COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${dest_binary}" "${output_path}") | ||
+ else() | ||
+ add_custom_command(OUTPUT ${output_path} | ||
+ COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${dest_binary}" "${output_path}" | ||
+ DEPENDS ${dest}) | ||
+ add_custom_target(${name} ALL DEPENDS ${output_path}) | ||
+ set_target_properties(${name} PROPERTIES FOLDER Tools) | ||
+ | ||
+ # Make sure the parent tool is a toolchain tool, otherwise exclude this tool | ||
+ list(FIND LLVM_TOOLCHAIN_TOOLS ${dest} LLVM_IS_${dest}_TOOLCHAIN_TOOL) | ||
+ if (NOT LLVM_IS_${dest}_TOOLCHAIN_TOOL GREATER -1) | ||
+ set(LLVM_IS_${name}_TOOLCHAIN_TOOL ${LLVM_IS_${dest}_TOOLCHAIN_TOOL}) | ||
+ else() | ||
+ list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL) | ||
+ endif() | ||
+ | ||
+ # LLVM_IS_${name}_TOOLCHAIN_TOOL will only be greater than -1 if both this | ||
+ # tool and its parent tool are in LLVM_TOOLCHAIN_TOOLS | ||
+ if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) | ||
+ if( LLVM_BUILD_TOOLS ) | ||
+ llvm_install_symlink(${name} ${dest}) | ||
+ endif() | ||
+ endif() | ||
+ endif() | ||
+endfunction() | ||
+ | ||
diff --git a/cmake/modules/LLVMInstallSymlink.cmake b/cmake/modules/LLVMInstallSymlink.cmake | ||
new file mode 100644 | ||
index 0000000..482697b | ||
--- /dev/null | ||
+++ b/cmake/modules/LLVMInstallSymlink.cmake | ||
@@ -0,0 +1,21 @@ | ||
+# We need to execute this script at installation time because the | ||
+# DESTDIR environment variable may be unset at configuration time. | ||
+# See PR8397. | ||
+ | ||
+function(install_symlink name target outdir) | ||
+ if(UNIX) | ||
+ set(LINK_OR_COPY create_symlink) | ||
+ set(DESTDIR $ENV{DESTDIR}) | ||
+ else() | ||
+ set(LINK_OR_COPY copy) | ||
+ endif() | ||
+ | ||
+ set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}/") | ||
+ | ||
+ message("Creating ${name}") | ||
+ | ||
+ execute_process( | ||
+ COMMAND "${CMAKE_COMMAND}" -E ${LINK_OR_COPY} "${target}" "${name}" | ||
+ WORKING_DIRECTORY "${bindir}") | ||
+ | ||
+endfunction() | ||
diff --git a/tools/llvm-ar/CMakeLists.txt b/tools/llvm-ar/CMakeLists.txt | ||
index 05ffe36..86233df 100644 | ||
--- a/tools/llvm-ar/CMakeLists.txt | ||
+++ b/tools/llvm-ar/CMakeLists.txt | ||
@@ -10,30 +10,5 @@ add_llvm_tool(llvm-ar | ||
llvm-ar.cpp | ||
) | ||
|
||
-if(UNIX) | ||
- set(LLVM_LINK_OR_COPY create_symlink) | ||
- set(llvm_ar_binary "llvm-ar${CMAKE_EXECUTABLE_SUFFIX}") | ||
-else() | ||
- set(LLVM_LINK_OR_COPY copy) | ||
- set(llvm_ar_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}") | ||
-endif() | ||
- | ||
-set(llvm_ranlib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib${CMAKE_EXECUTABLE_SUFFIX}") | ||
- | ||
-add_custom_command(OUTPUT ${llvm_ranlib} | ||
- COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_ranlib}" | ||
- DEPENDS llvm-ar) | ||
- | ||
-add_custom_target(llvm-ranlib ALL DEPENDS ${llvm_ranlib}) | ||
-set_target_properties(llvm-ranlib PROPERTIES FOLDER Tools) | ||
- | ||
-set(llvm_lib "${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lib${CMAKE_EXECUTABLE_SUFFIX}") | ||
- | ||
-add_custom_command(OUTPUT ${llvm_lib} | ||
- COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${llvm_ar_binary}" "${llvm_lib}" | ||
- DEPENDS llvm-ar) | ||
- | ||
-add_custom_target(llvm-lib ALL DEPENDS ${llvm_lib}) | ||
-set_target_properties(llvm-lib PROPERTIES FOLDER Tools) | ||
- | ||
-install(SCRIPT install_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\") | ||
+add_llvm_tool_symlink(llvm-ranlib llvm-ar) | ||
+add_llvm_tool_symlink(llvm-lib llvm-ar) |
Oops, something went wrong.