Skip to content
Snippets Groups Projects
Commit 02be2c75 authored by Timo Koch's avatar Timo Koch
Browse files

[cmake] Force ".so" suffix for pybind11 module libraries on macOS

parent 2917908b
Branches
Tags
1 merge request!799[cmake] Force ".so" suffix for pybind11 module libraries on macOS
......@@ -72,6 +72,13 @@ function(dune_add_pybind11_module)
add_library(${PYBIND11_MODULE_NAME} SHARED ${PYBIND11_MODULE_SOURCES})
set_target_properties(${PYBIND11_MODULE_NAME} PROPERTIES PREFIX "")
# force '.so' as library suffix on macOS due to a problem in Python
# https://stackoverflow.com/questions/2488016/how-to-make-python-load-dylib-on-osx
if (APPLE)
set_target_properties(${PYBIND11_MODULE_NAME} PROPERTIES SUFFIX ".so")
endif()
target_compile_definitions(${PYBIND11_MODULE_NAME} PRIVATE ${PYBIND11_MODULE_COMPILE_DEFINITIONS})
dune_target_enable_all_packages(${PYBIND11_MODULE_NAME})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment