Skip to content

Commit 6bb4911

Browse files
committed
[cmake] Add an option to skip stripping before install
The swift build system has support for cross-compiling, installing, and generating symbols for lldb. As the swift symbol-generation step occurs after installation, we need to disable stripping during the install. (cherry picked from commit 610f80f)
1 parent 565eac5 commit 6bb4911

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lldb/cmake/modules/AddLLDB.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ function(lldb_add_post_install_steps_darwin name install_prefix)
260260
install(CODE "execute_process(COMMAND xcrun dsymutil -o=${dsym_name} ${buildtree_name})"
261261
COMPONENT ${name})
262262

263-
# Strip distribution binary with -ST (removing debug symbol table entries and
264-
# Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo()
265-
# as they can't be configured sufficiently.
266-
set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}")
267-
install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name})
268-
install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})"
269-
COMPONENT ${name})
263+
if(NOT LLDB_SKIP_STRIP)
264+
# Strip distribution binary with -ST (removing debug symbol table entries and
265+
# Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo()
266+
# as they can't be configured sufficiently.
267+
set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}")
268+
install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name})
269+
install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})"
270+
COMPONENT ${name})
271+
endif()
270272
endfunction()
271273

272274
# CMake's set_target_properties() doesn't allow to pass lists for RPATH

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" O
5151
option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
5252
option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF)
5353
option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF)
54+
option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF)
5455

5556
if(LLDB_BUILD_FRAMEWORK)
5657
if(NOT APPLE)

0 commit comments

Comments
 (0)