[PATCH] D40680: [libc++] Create install-stripped targets

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 14:51:43 PST 2017


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

LLVM is gaining install-*-stripped targets to perform stripped installs,
and in order for this to be useful for install-distribution, all
potential distribution components should have stripped installation
targets. LLVM has a function to create these install targets, but since
we can't use LLVM CMake functions in libc++, let's do it manually.


https://reviews.llvm.org/D40680

Files:
  include/CMakeLists.txt
  lib/CMakeLists.txt


Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -389,5 +389,14 @@
                       COMMAND "${CMAKE_COMMAND}"
                       -DCMAKE_INSTALL_COMPONENT=cxx
                       -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
+    add_custom_target(install-cxx-stripped
+                      DEPENDS ${lib_install_target}
+                              ${experimental_lib_install_target}
+                              ${header_install_target}
+                      COMMAND "${CMAKE_COMMAND}"
+                      -DCMAKE_INSTALL_COMPONENT=cxx
+                      -DCMAKE_INSTALL_DO_STRIP=1
+                      -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
     add_custom_target(install-libcxx DEPENDS install-cxx)
+    add_custom_target(install-libcxx-stripped DEPENDS install-cxx-stripped)
 endif()
Index: include/CMakeLists.txt
===================================================================
--- include/CMakeLists.txt
+++ include/CMakeLists.txt
@@ -58,9 +58,12 @@
                       COMMAND "${CMAKE_COMMAND}"
                               -DCMAKE_INSTALL_COMPONENT=cxx-headers
                               -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+    # Stripping is a no-op for headers
+    add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
 
     add_custom_target(libcxx-headers)
     add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)
+    add_custom_target(install-libcxx-headers-stripped DEPENDS install-libcxx-headers)
   endif()
 
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40680.125031.patch
Type: text/x-patch
Size: 1634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171130/b6ec3403/attachment.bin>


More information about the cfe-commits mailing list