Skip to content

Commit a7e7a6e

Browse files
authored
Docs: No Strip in Debug (#3779)
The docs were not 100% the same as we advertise with our tooling function: most users do not want to strip symbols in Debug builds.
1 parent f8a532a commit a7e7a6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/compiling.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ You can use these targets to build complex applications. For example, the
505505
target_link_libraries(example PRIVATE pybind11::module pybind11::lto pybind11::windows_extras)
506506
507507
pybind11_extension(example)
508-
pybind11_strip(example)
508+
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
509+
# Strip unnecessary sections of the binary on Linux/macOS
510+
pybind11_strip(example)
511+
endif()
509512
510513
set_target_properties(example PROPERTIES CXX_VISIBILITY_PRESET "hidden"
511514
CUDA_VISIBILITY_PRESET "hidden")

0 commit comments

Comments
 (0)