Skip to content

Commit

Permalink
Fix pybind11 compilation on focal/clang12 combo (#400)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2022
1 parent ed2300a commit fb741dd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/python_pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ target_link_libraries(math PRIVATE
${PROJECT_LIBRARY_TARGET_NAME}
)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# Workaround for Clang and pybind11 on Focal
# https://github.com/pybind/pybind11/issues/1604
# Resolved by newer versions of pybind11
if(${pybind11_VERSION} VERSION_LESS "2.4.4")
target_compile_options(math PRIVATE -fsized-deallocation)
endif()

# Suppress warnings that clang misidentifies:
# https://github.com/pybind/pybind11/issues/1893
target_compile_options(math PRIVATE -Wno-self-assign-overloaded)
endif()

if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
execute_process(
Expand Down

0 comments on commit fb741dd

Please sign in to comment.