Skip to content

Commit cb7b711

Browse files
author
Tomoya Fujita
authored
remove ament_export_link_flags() for atomic operations. (ros2#528)
* remove ament_export_link_flags() for atomic operations. Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> * adjust the comment. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> --------- Signed-off-by: Tomoya.Fujita <tomoya.fujita825@gmail.com> Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
1 parent 974a1b1 commit cb7b711

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS})
100100
check_library_exists(atomic __atomic_load_8 "" HAVE_LIBATOMICS)
101101

102102
if(HAVE_LIBATOMICS AND NOT WIN32)
103-
# Exporting link flag since it won't pass ament_export_libraries() existence check
104-
ament_export_link_flags("-latomic")
103+
# Link libatomic into rcutils for fault injection atomic operations.
104+
# Don't export it - downstream packages get atomic symbols transitively
105+
# through librcutils.so. See https://github.com/ros2/rcutils/issues/525
105106
target_link_libraries(${PROJECT_NAME} atomic)
106107
endif()
107108

0 commit comments

Comments
 (0)