[compiler-rt] r319569 - [compiler-rt] Add install-*-stripped targets

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:06:30 PST 2017


Author: smeenai
Date: Fri Dec  1 11:06:29 2017
New Revision: 319569

URL: http://llvm.org/viewvc/llvm-project?rev=319569&view=rev
Log:
[compiler-rt] Add install-*-stripped targets

These targets strip during installation, and are required to support
install-distribution-stripped in LLVM (to support a stripped
distribution). LLVM has an add_llvm_install_targets function for this
purpose, but we can't rely on LLVM being present.

Differential Revision: https://reviews.llvm.org/D40687

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
    compiler-rt/trunk/cmake/base-config-ix.cmake

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=319569&r1=319568&r2=319569&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Fri Dec  1 11:06:29 2017
@@ -210,9 +210,18 @@ function(add_compiler_rt_runtime name ty
                         COMMAND "${CMAKE_COMMAND}"
                                 -DCMAKE_INSTALL_COMPONENT=${LIB_PARENT_TARGET}
                                 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+      add_custom_target(install-${LIB_PARENT_TARGET}-stripped
+                        DEPENDS ${LIB_PARENT_TARGET}
+                        COMMAND "${CMAKE_COMMAND}"
+                                -DCMAKE_INSTALL_COMPONENT=${LIB_PARENT_TARGET}
+                                -DCMAKE_INSTALL_DO_STRIP=1
+                                -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
       set_target_properties(install-${LIB_PARENT_TARGET} PROPERTIES
                             FOLDER "Compiler-RT Misc")
+      set_target_properties(install-${LIB_PARENT_TARGET}-stripped PROPERTIES
+                            FOLDER "Compiler-RT Misc")
       add_dependencies(install-compiler-rt install-${LIB_PARENT_TARGET})
+      add_dependencies(install-compiler-rt-stripped install-${LIB_PARENT_TARGET}-stripped)
     endif()
   endif()
 
@@ -267,10 +276,17 @@ function(add_compiler_rt_runtime name ty
                         COMMAND "${CMAKE_COMMAND}"
                                 -DCMAKE_INSTALL_COMPONENT=${libname}
                                 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+      add_custom_target(install-${libname}-stripped
+                        DEPENDS ${libname}
+                        COMMAND "${CMAKE_COMMAND}"
+                                -DCMAKE_INSTALL_COMPONENT=${libname}
+                                -DCMAKE_INSTALL_DO_STRIP=1
+                                -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
       # If you have a parent target specified, we bind the new install target
       # to the parent install target.
       if(LIB_PARENT_TARGET)
         add_dependencies(install-${LIB_PARENT_TARGET} install-${libname})
+        add_dependencies(install-${LIB_PARENT_TARGET}-stripped install-${libname}-stripped)
       endif()
     endif()
     if(APPLE)

Modified: compiler-rt/trunk/cmake/base-config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/base-config-ix.cmake?rev=319569&r1=319568&r2=319569&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/base-config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/base-config-ix.cmake Fri Dec  1 11:06:29 2017
@@ -11,6 +11,7 @@ check_include_file(unwind.h HAVE_UNWIND_
 # Top level target used to build all compiler-rt libraries.
 add_custom_target(compiler-rt ALL)
 add_custom_target(install-compiler-rt)
+add_custom_target(install-compiler-rt-stripped)
 set_target_properties(compiler-rt PROPERTIES FOLDER "Compiler-RT Misc")
 
 # Setting these variables from an LLVM build is sufficient that compiler-rt can




More information about the llvm-commits mailing list