[PATCH] D40620: [llvm] Add option to strip binaries during installation

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 13:18:20 PST 2017


smeenai created this revision.
Herald added a subscriber: mgorny.

CMake's generated installation scripts support `CMAKE_INSTALL_DO_STRIP`
to enable stripping the installed binaries. LLVM's build system doesn't
currently expose this option to the `install-` targets, but it's
particularly useful for `install-distribution`. Add a CMake option
`LLVM_INSTALL_STRIPPED_BINARIES` to support stripping during
installation when using the `install-` targets.

I briefly toyed with the idea of adding a function to create an
`install-` target, changing all such creations to use that function, and
then add the stripping support to just that function. Some of the
install targets have small differences though, and I ultimately decided
it wasn't worth unifying everything, since the install target creation
is just a single CMake command anyway. Additionally, some projects (such
as libc++) can't rely on LLVM's CMake, so those couldn't have used this
hypothetical function anyway.

Once this is in, I'll add support for this option to clang, compiler-rt,
libc++, etc. in follow-ups.


https://reviews.llvm.org/D40620

Files:
  CMakeLists.txt
  cmake/modules/AddLLVM.cmake
  cmake/modules/CMakeLists.txt
  cmake/modules/LLVMExternalProjectUtils.cmake
  docs/CMake.rst
  tools/xcode-toolchain/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40620.124807.patch
Type: text/x-patch
Size: 5829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171129/2436342f/attachment.bin>


More information about the llvm-commits mailing list