From 7aeb957c2c2992e704d0bb1ec5fe23553ccc514e Mon Sep 17 00:00:00 2001 From: dhood Date: Thu, 28 Apr 2016 15:27:12 -0700 Subject: [PATCH] Workaround for the change in libnddscore.so in connext 5.2.0 between gcc4.6.3 and gcc4.8.2 (#55) * Workaround for the change in libnddscore.so in connext 5.2.0 between gcc4.6.3 and gcc4.8.2 * Prefix macro variables with underscore --- rcl/test/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rcl/test/CMakeLists.txt b/rcl/test/CMakeLists.txt index 8bc5bc0..620a3c3 100644 --- a/rcl/test/CMakeLists.txt +++ b/rcl/test/CMakeLists.txt @@ -129,6 +129,13 @@ function(test_target_function) AMENT_DEPENDENCIES ${rmw_implementation} "example_interfaces" ) + # TODO remove this once connext declares libdl dependency in libnddscore again + # See https://github.com/ros2/rcl/issues/52 + if("${rmw_implementation} " STREQUAL "rmw_connext_cpp ") + connext_workaround(client_fixture${target_suffix}) + connext_workaround(service_fixture${target_suffix}) + endif() + rcl_add_custom_launch_test(test_services service_fixture client_fixture @@ -139,4 +146,15 @@ function(test_target_function) ) endfunction() +macro(connext_workaround target) + if("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU ") + get_target_property(_current_link_flags ${target} LINK_FLAGS) + set(_link_flags "-Wl,--no-as-needed") + if(_current_link_flags) + set(_link_flags ${_current_link_flags} ${_link_flags}) + endif() + set_target_properties(${target} PROPERTIES LINK_FLAGS "${_link_flags}") + endif() +endmacro() + call_for_each_rmw_implementation(test_target)