diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake index b04441020606ee..b58a62ca777104 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -284,13 +284,15 @@ function(lldb_add_post_install_steps_darwin name install_prefix) install(CODE "execute_process(COMMAND xcrun dsymutil -o=${dsym_name} ${buildtree_name})" COMPONENT ${name}) - # Strip distribution binary with -ST (removing debug symbol table entries and - # Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo() - # as they can't be configured sufficiently. - set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}") - install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name}) - install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})" - COMPONENT ${name}) + if(NOT LLDB_SKIP_STRIP) + # Strip distribution binary with -ST (removing debug symbol table entries and + # Swift symbols). Avoid CMAKE_INSTALL_DO_STRIP and llvm_externalize_debuginfo() + # as they can't be configured sufficiently. + set(installtree_name "\$ENV\{DESTDIR\}${install_prefix}/${bundle_subdir}${output_name}") + install(CODE "message(STATUS \"Stripping: ${installtree_name}\")" COMPONENT ${name}) + install(CODE "execute_process(COMMAND xcrun strip -ST ${installtree_name})" + COMPONENT ${name}) + endif() endfunction() # CMake's set_target_properties() doesn't allow to pass lists for RPATH diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake index 6c6930d86e8f0c..c042cbf1b22e9e 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -52,6 +52,7 @@ option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" O option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF) option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF) option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF) +option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF) if(LLDB_BUILD_FRAMEWORK) if(NOT APPLE)