Skip to content

Commit ab157fe

Browse files
Fix Python linking on osx
Signed-off-by: Tobias Fischer <info@tobiasfischer.info>
1 parent c67e43a commit ab157fe

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

rclpy/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,17 @@ add_library(rclpy_common SHARED
126126
)
127127
target_link_libraries(rclpy_common PUBLIC
128128
pybind11::pybind11
129-
${PYTHON_LIBRARIES}
130129
rcl::rcl
131130
rmw::rmw
132131
)
132+
133+
if(NOT APPLE)
134+
target_link_libraries(rclpy_common ${PYTHON_LIBRARIES})
135+
else()
136+
set_target_properties(rclpy_common PROPERTIES
137+
LINK_FLAGS "-undefined dynamic_lookup")
138+
endif()
139+
133140
target_include_directories(rclpy_common PUBLIC
134141
src/rclpy_common/include
135142
)

0 commit comments

Comments
 (0)