From ab157fefbcbe8cb5e6e95440a1d1f3ce02fb0118 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Wed, 21 Jul 2021 08:25:53 +1000 Subject: [PATCH 1/2] Fix Python linking on osx Signed-off-by: Tobias Fischer --- rclpy/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rclpy/CMakeLists.txt b/rclpy/CMakeLists.txt index 351009c71..47d862e4c 100644 --- a/rclpy/CMakeLists.txt +++ b/rclpy/CMakeLists.txt @@ -126,10 +126,17 @@ add_library(rclpy_common SHARED ) target_link_libraries(rclpy_common PUBLIC pybind11::pybind11 - ${PYTHON_LIBRARIES} rcl::rcl rmw::rmw ) + +if(NOT APPLE) + target_link_libraries(rclpy_common ${PYTHON_LIBRARIES}) +else() + set_target_properties(rclpy_common PROPERTIES + LINK_FLAGS "-undefined dynamic_lookup") +endif() + target_include_directories(rclpy_common PUBLIC src/rclpy_common/include ) From fd29665b470a05ed223c9dcfa73ae79cf7cf5333 Mon Sep 17 00:00:00 2001 From: Tobias Fischer Date: Wed, 21 Jul 2021 09:04:56 +1000 Subject: [PATCH 2/2] Fix new style link Signed-off-by: Tobias Fischer --- rclpy/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclpy/CMakeLists.txt b/rclpy/CMakeLists.txt index 47d862e4c..6f6ead39c 100644 --- a/rclpy/CMakeLists.txt +++ b/rclpy/CMakeLists.txt @@ -131,7 +131,7 @@ target_link_libraries(rclpy_common PUBLIC ) if(NOT APPLE) - target_link_libraries(rclpy_common ${PYTHON_LIBRARIES}) + target_link_libraries(rclpy_common PUBLIC ${PYTHON_LIBRARIES}) else() set_target_properties(rclpy_common PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")