Skip to content

Commit 419fc2a

Browse files
Do not link against PYTHON_LIBRARIES on macOS
Signed-off-by: Tobias-Fischer <[email protected]>
1 parent 17de859 commit 419fc2a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,17 @@ add_dependencies(
169169
${rosidl_generate_interfaces_TARGET}__rosidl_typesupport_c
170170
)
171171

172-
target_link_libraries(
173-
${_target_name_lib}
174-
${PythonExtra_LIBRARIES}
175-
)
172+
173+
if(NOT APPLE)
174+
target_link_libraries(
175+
${_target_name_lib}
176+
${PythonExtra_LIBRARIES}
177+
)
178+
else()
179+
set_target_properties(${_target_name_lib} PROPERTIES
180+
LINK_FLAGS "-undefined dynamic_lookup")
181+
endif()
182+
176183
target_include_directories(${_target_name_lib}
177184
PUBLIC
178185
${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_c

0 commit comments

Comments
 (0)