OSDN Git Service

[CMake] Provide the ability to skip stripping when generating dSYMs
authorChris Bieneman <beanz@apple.com>
Thu, 31 Mar 2016 20:03:19 +0000 (20:03 +0000)
committerChris Bieneman <beanz@apple.com>
Thu, 31 Mar 2016 20:03:19 +0000 (20:03 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265041 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddLLVM.cmake

index 1fd0c14..294e39b 100644 (file)
@@ -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()