Skip to content

Commit

Permalink
fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddinu authored Aug 8, 2022
1 parent 29f4940 commit 8a4bca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tools/pybind11NewTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ function(pybind11_add_module target_name)
endif()
endif()

if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
# 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)
# Strip unnecessary sections of the binary on Linux/macOS
pybind11_strip(${target_name})
endif()
Expand Down
4 changes: 3 additions & 1 deletion tools/pybind11Tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ function(pybind11_add_module target_name)
endif()
endif()

if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
# 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)
pybind11_strip(${target_name})
endif()

Expand Down

0 comments on commit 8a4bca8

Please sign in to comment.