summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-12-01 19:06:29 +0000
committerShoaib Meenai <smeenai@fb.com>2017-12-01 19:06:29 +0000
commitdb05652021121579eab67232043969ecbfaac152 (patch)
treecb5fc01124c42bee185b4cbe8a2084d73fdcce8d /cmake/Modules
parent938b84c82450f523d883f8bafe6e8269673bb49c (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 8f9857923..f01cba900 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -210,9 +210,18 @@ function(add_compiler_rt_runtime name type)
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 type)
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)