Skip to content

Commit

Permalink
fix(cmake): don't strip with BUILD_TYPE None (#5392)
Browse files Browse the repository at this point in the history
Debian builds with None by default and takes care of stripping itself.
This allows building debug symbol packages.
  • Loading branch information
jspricke authored Jan 24, 2025
1 parent 1b7aa0b commit 167bb5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/pybind11NewTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function(pybind11_add_module target_name)
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
# Strip unnecessary sections of the binary on Linux/macOS
pybind11_strip(${target_name})
endif()
Expand Down
2 changes: 1 addition & 1 deletion tools/pybind11Tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function(pybind11_add_module target_name)
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO)
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
pybind11_strip(${target_name})
endif()
endif()
Expand Down

0 comments on commit 167bb5f

Please sign in to comment.