Skip to content

Commit 167bb5f

Browse files
authored
fix(cmake): don't strip with BUILD_TYPE None (#5392)
Debian builds with None by default and takes care of stripping itself. This allows building debug symbol packages.
1 parent 1b7aa0b commit 167bb5f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/pybind11NewTools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function(pybind11_add_module target_name)
307307
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
308308
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
309309
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
310-
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO)
310+
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
311311
# Strip unnecessary sections of the binary on Linux/macOS
312312
pybind11_strip(${target_name})
313313
endif()

tools/pybind11Tools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function(pybind11_add_module target_name)
196196
if(DEFINED CMAKE_BUILD_TYPE) # see https://github.com/pybind/pybind11/issues/4454
197197
# Use case-insensitive comparison to match the result of $<CONFIG:cfgs>
198198
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
199-
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO)
199+
if(NOT MSVC AND NOT "${uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO|NONE)
200200
pybind11_strip(${target_name})
201201
endif()
202202
endif()

0 commit comments

Comments
 (0)