File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3")
3636
3737target_link_libraries (${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph)
3838
39+ # The public linking with pybind lead to have a link with libpython which
40+ # propagates in the python module .so. On macOS, this extra link with libpython
41+ # lead to segv when importing the python module in versions of python that don't
42+ # have a dynamic link with libpython (such as the one provided by conda), but works
43+ # fine with versions that have such link.
3944if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
4045 target_link_libraries (${PROJECT_NAME} PRIVATE pybind11::embed)
4146else ()
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ set(SOURCE_FILES
1616
1717add_library (${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} )
1818target_link_libraries (${PROJECT_NAME} PUBLIC Sofa.Testing SofaPython3::Plugin)
19+ # We wan't the pybind11 dependency to propagate to SofaPython3Testing consumers,
20+ # here Bindings.*.Tests
21+ if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
22+ target_link_libraries (${PROJECT_NAME} PUBLIC pybind11::embed)
23+ endif ()
1924target_compile_definitions (${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3" )
2025set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Testing)
2126
You can’t perform that action at this time.
0 commit comments