From 17bcc439d63e8d33405eaf288b9bd6ba8f046ee0 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 31 Mar 2016 21:17:19 +0000 Subject: [PATCH] [CMake] Provide the ability to skip stripping when generating dSYMs For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On. llvm-svn: 265057 --- compiler-rt/cmake/Modules/AddCompilerRT.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 13b85338..6991009 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -362,6 +362,10 @@ function(rt_externalize_debuginfo name) return() endif() + if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP) + set(strip_command COMMAND xcrun strip -Sl $) + endif() + if(APPLE) if(CMAKE_CXX_FLAGS MATCHES "-flto" OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto") @@ -372,7 +376,7 @@ function(rt_externalize_debuginfo name) endif() add_custom_command(TARGET ${name} POST_BUILD COMMAND xcrun dsymutil $ - COMMAND xcrun strip -Sl $) + ${strip_command}) else() message(FATAL_ERROR "COMPILER_RT_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!") endif() -- 2.7.4