[llvm] r265041 - [CMake] Provide the ability to skip stripping when generating dSYMs

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 13:03:19 PDT 2016


Author: cbieneman
Date: Thu Mar 31 15:03:19 2016
New Revision: 265041

URL: http://llvm.org/viewvc/llvm-project?rev=265041&view=rev
Log:
[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 LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On.

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=265041&r1=265040&r2=265041&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Thu Mar 31 15:03:19 2016
@@ -1185,6 +1185,10 @@ function(llvm_externalize_debuginfo name
     return()
   endif()
 
+  if(NOT LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
+    set(strip_command COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
+  endif()
+
   if(APPLE)
     if(CMAKE_CXX_FLAGS MATCHES "-flto"
       OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
@@ -1195,7 +1199,8 @@ function(llvm_externalize_debuginfo name
     endif()
     add_custom_command(TARGET ${name} POST_BUILD
       COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
-      COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
+      ${strip_command}
+      )
   else()
     message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
   endif()




More information about the llvm-commits mailing list