Skip to content

Commit 610f80f

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.
1 parent 6db7a5c commit 610f80f

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
@@ -284,13 +284,15 @@ function(lldb_add_post_install_steps_darwin name install_prefix)
284284
install(CODE "execute_process(COMMAND xcrun dsymutil -o=${dsym_name} ${buildtree_name})"
285285
COMPONENT ${name})
286286

287-
# Strip distribution binary with -ST (removing debug symbol table entries and
288-
# Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo()
289-
# as they can't be configured sufficiently.
290-
set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}")
291-
install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name})
292-
install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})"
293-
COMPONENT ${name})
287+
if(NOT LLDB_SKIP_STRIP)
288+
# Strip distribution binary with -ST (removing debug symbol table entries and
289+
# Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo()
290+
# as they can't be configured sufficiently.
291+
set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}")
292+
install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name})
293+
install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})"
294+
COMPONENT ${name})
295+
endif()
294296
endfunction()
295297

296298
# 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
@@ -52,6 +52,7 @@ option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" O
5252
option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
5353
option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF)
5454
option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF)
55+
option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF)
5556

5657
if(LLDB_BUILD_FRAMEWORK)
5758
if(NOT APPLE)

0 commit comments

Comments
 (0)