@@ -12,6 +12,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1212endif ()
1313
1414find_package (ament_cmake_ros REQUIRED)
15+ find_package (rcutils REQUIRED)
1516find_package (rosidl_typesupport_interface REQUIRED)
1617
1718add_library (${PROJECT_NAME}
@@ -26,6 +27,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
2627 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
2728 "$<INSTALL_INTERFACE:include>" )
2829ament_target_dependencies(${PROJECT_NAME}
30+ "rcutils"
2931 "rosidl_typesupport_interface" )
3032if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
3133 set_target_properties (${PROJECT_NAME} PROPERTIES
@@ -36,7 +38,11 @@ if(WIN32)
3638 PRIVATE "ROSIDL_GENERATOR_C_BUILDING_DLL" )
3739endif ()
3840
39- ament_export_dependencies(rosidl_typesupport_interface)
41+ if (BUILD_TESTING AND NOT RCUTILS_DISABLE_FAULT_INJECTION)
42+ target_compile_definitions (${PROJECT_NAME} PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
43+ endif ()
44+
45+ ament_export_dependencies(rcutils rosidl_typesupport_interface)
4046ament_export_include_directories(include )
4147ament_export_libraries(${PROJECT_NAME} )
4248ament_export_targets(${PROJECT_NAME} )
@@ -86,12 +92,14 @@ if(BUILD_TESTING)
8692 if (TARGET test_string_functions)
8793 target_include_directories (test_string_functions PUBLIC include )
8894 target_link_libraries (test_string_functions ${PROJECT_NAME} )
95+ target_compile_definitions (test_string_functions PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
8996 endif ()
9097
9198 ament_add_gtest(test_u16string_functions test /test_u16string_functions.cpp)
9299 if (TARGET test_u16string_functions)
93100 target_include_directories (test_u16string_functions PUBLIC include )
94101 target_link_libraries (test_u16string_functions ${PROJECT_NAME} )
102+ target_compile_definitions (test_u16string_functions PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
95103 endif ()
96104endif ()
97105
0 commit comments