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")
36
36
37
37
target_link_libraries (${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph)
38
38
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.
39
44
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
40
45
target_link_libraries (${PROJECT_NAME} PRIVATE pybind11::embed)
41
46
else ()
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ set(SOURCE_FILES
16
16
17
17
add_library (${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} )
18
18
target_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 ()
19
24
target_compile_definitions (${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3" )
20
25
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER Testing)
21
26
You can’t perform that action at this time.
0 commit comments