@@ -12,6 +12,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
12
12
endif ()
13
13
14
14
find_package (ament_cmake_ros REQUIRED)
15
+ find_package (rcutils REQUIRED)
15
16
find_package (rosidl_typesupport_interface REQUIRED)
16
17
17
18
add_library (${PROJECT_NAME}
@@ -26,6 +27,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
26
27
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
27
28
"$<INSTALL_INTERFACE:include>" )
28
29
ament_target_dependencies(${PROJECT_NAME}
30
+ "rcutils"
29
31
"rosidl_typesupport_interface" )
30
32
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
31
33
set_target_properties (${PROJECT_NAME} PROPERTIES
@@ -36,7 +38,11 @@ if(WIN32)
36
38
PRIVATE "ROSIDL_GENERATOR_C_BUILDING_DLL" )
37
39
endif ()
38
40
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)
40
46
ament_export_include_directories(include )
41
47
ament_export_libraries(${PROJECT_NAME} )
42
48
ament_export_targets(${PROJECT_NAME} )
@@ -86,12 +92,14 @@ if(BUILD_TESTING)
86
92
if (TARGET test_string_functions)
87
93
target_include_directories (test_string_functions PUBLIC include )
88
94
target_link_libraries (test_string_functions ${PROJECT_NAME} )
95
+ target_compile_definitions (test_string_functions PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
89
96
endif ()
90
97
91
98
ament_add_gtest(test_u16string_functions test /test_u16string_functions.cpp)
92
99
if (TARGET test_u16string_functions)
93
100
target_include_directories (test_u16string_functions PUBLIC include )
94
101
target_link_libraries (test_u16string_functions ${PROJECT_NAME} )
102
+ target_compile_definitions (test_u16string_functions PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
95
103
endif ()
96
104
endif ()
97
105
0 commit comments