Merge pull request #415 from tdsmith/darwin-python

Don't explicitly link libpython on OS X
This commit is contained in:
John Wiegley 2015-05-04 22:34:27 -05:00
commit 974da27ed4

View file

@ -225,7 +225,14 @@ macro(add_ledger_library_dependencies _target)
target_link_libraries(${_target} ${INTL_LIB})
endif()
if (HAVE_BOOST_PYTHON)
target_link_libraries(${_target} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
if(APPLE)
# Don't link directly to a Python framework on OS X, to avoid segfaults
# when the module is imported from a different interpreter
target_link_libraries(${_target} ${Boost_LIBRARIES})
set_target_properties(${_target} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
else()
target_link_libraries(${_target} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
endif()
else()
target_link_libraries(${_target} ${Boost_LIBRARIES})
endif()