[PATCH] D71951: [CMake] Pass symlink dependency to add_llvm_install_targets explicitly
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 27 16:35:56 PST 2019
phosek created this revision.
phosek added reviewers: smeenai, beanz.
Herald added subscribers: llvm-commits, mgorny.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.
The install-${name}-stripped targets don't strip when ${name} is being
symlinked, e.g. llvm-ar or llvm-objcopy. The problem is that
llvm_install_symlink passes install-${dest} as a dependency of
install-${name}, e.g. install-llvm-ar becomes a dependency of both
install-llvm-ranlib and install-llvm-ranlib-stripped. What this means is
that when installing a distribution that contains both llvm-ar and
llvm-ranlib is that first the stripped version of llvm-ar is installed
(by the install-llvm-ar-stripped target) and then it's overwritten by an
unstripped version of llvm-ar bnecause install-llvm-ranlib-stripped has
install-llvm-ranlib as a dependency as mentioned earlier. To avoid this
issue, rather than passing the install-${dest} as dependency, we
introduce a new argument to add_llvm_install_targets for symlink target
which expands it into an appropriate dependency, i.e. install-${dest}
for install-${name} target and install-${dest}-stripped for
install-${name}-stripped.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71951
Files:
llvm/cmake/modules/AddLLVM.cmake
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -639,7 +639,7 @@
endfunction()
function(add_llvm_install_targets target)
- cmake_parse_arguments(ARG "" "COMPONENT;PREFIX" "DEPENDS" ${ARGN})
+ cmake_parse_arguments(ARG "" "COMPONENT;PREFIX;SYMLINK" "DEPENDS" ${ARGN})
if(ARG_COMPONENT)
set(component_option -DCMAKE_INSTALL_COMPONENT="${ARG_COMPONENT}")
endif()
@@ -676,6 +676,11 @@
add_dependencies(${target} ${target_dependencies})
add_dependencies(${target}-stripped ${target_dependencies})
endif()
+
+ if(ARG_SYMLINK)
+ add_dependencies(${target} install-${ARG_SYMLINK})
+ add_dependencies(${target}-stripped install-${ARG_SYMLINK}-stripped)
+ endif()
endfunction()
function(add_llvm_component_library name)
@@ -1545,8 +1550,9 @@
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
add_llvm_install_targets(install-${name}
- DEPENDS ${name} ${dest} install-${dest}
- COMPONENT ${name})
+ DEPENDS ${name} ${dest}
+ COMPONENT ${name}
+ SYMLINK ${dest})
endif()
endfunction()
@@ -1578,8 +1584,9 @@
if (NOT LLVM_ENABLE_IDE AND NOT ARG_ALWAYS_GENERATE)
add_llvm_install_targets(install-${name}
- DEPENDS ${name} ${dest} install-${dest}
- COMPONENT ${name})
+ DEPENDS ${name} ${dest}
+ COMPONENT ${name}
+ SYMLINK ${dest})
endif()
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71951.235454.patch
Type: text/x-patch
Size: 1733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191228/1a1d322d/attachment.bin>
More information about the llvm-commits
mailing list