12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- find_package (rmw_implementation_cmake REQUIRED)
16
- find_package (rmw REQUIRED)
17
-
18
15
if (NOT WIN32 )
19
16
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
20
17
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
@@ -23,17 +20,8 @@ if(NOT WIN32)
23
20
endif ()
24
21
endif ()
25
22
26
- # Get a list of typesupport implementations from valid rmw implementations.
27
- rosidl_generator_rs_get_typesupports(_typesupport_impls)
28
-
29
- if (_typesupport_impls STREQUAL "" )
30
- message (WARNING "No valid typesupport for Rust generator. Rust messages will not be generated." )
31
- return ()
32
- endif ()
33
-
34
23
set (_output_path
35
24
"${CMAKE_CURRENT_BINARY_DIR} /rosidl_generator_rs/${PROJECT_NAME} " )
36
- set (_generated_extension_files "" )
37
25
set (_generated_common_rs_files "" )
38
26
39
27
set (_generated_msg_rs_files "" )
@@ -42,10 +30,6 @@ set(_generated_srv_rs_files "")
42
30
set (_has_msg FALSE )
43
31
set (_has_srv FALSE )
44
32
45
- foreach (_typesupport_impl ${_typesupport_impls} )
46
- set (_generated_extension_${_typesupport_impl} _files "" )
47
- endforeach ()
48
-
49
33
foreach (_idl_file ${rosidl_generate_interfaces_ABS_IDL_FILES} )
50
34
get_filename_component (_parent_folder "${_idl_file} " DIRECTORY )
51
35
get_filename_component (_parent_folder "${_parent_folder} " NAME )
@@ -75,22 +59,12 @@ if(${_has_msg})
75
59
list (APPEND _generated_msg_rs_files
76
60
"${_output_path} /rust/src/msg.rs"
77
61
)
78
-
79
- foreach (_typesupport_impl ${_typesupport_impls} )
80
- list_append_unique(_generated_extension_${_typesupport_impl} _files "${_output_path} /msg_rs.ep.${_typesupport_impl} .c" )
81
- list_append_unique(_generated_extension_files "${_generated_extension_${_typesupport_impl} _files}" )
82
- endforeach ()
83
62
endif ()
84
63
85
64
if (${_has_srv} )
86
65
list (APPEND _generated_srv_rs_files
87
66
"${_output_path} /rust/src/srv.rs"
88
67
)
89
-
90
- foreach (_typesupport_impl ${_typesupport_impls} )
91
- list_append_unique(_generated_extension_${_typesupport_impl} _files "${_output_path} /srv_rs.ep.${_typesupport_impl} .c" )
92
- list_append_unique(_generated_extension_files "${_generated_extension_${_typesupport_impl} _files}" )
93
- endforeach ()
94
68
endif ()
95
69
96
70
set (_dependency_files "" )
@@ -156,23 +130,18 @@ add_dependencies(${rosidl_generate_interfaces_TARGET} ${rosidl_generate_interfac
156
130
157
131
set_property (
158
132
SOURCE
159
- ${_generated_extension_files}
160
133
${_generated_common_rs_files}
161
134
${_generated_msg_rs_files}
162
135
${_generated_srv_rs_files}
163
136
PROPERTY GENERATED 1)
164
137
165
138
set (_rsext_suffix "__rsext" )
166
- foreach (_typesupport_impl ${_typesupport_impls} )
167
- find_package (${_typesupport_impl} REQUIRED)
168
-
169
- if (NOT rosidl_generate_interfaces_SKIP_INSTALL)
170
- install (
171
- DIRECTORY "${_output_path} /rust"
172
- DESTINATION "share/${PROJECT_NAME} "
173
- )
174
- endif ()
175
- endforeach ()
139
+ if (NOT rosidl_generate_interfaces_SKIP_INSTALL)
140
+ install (
141
+ DIRECTORY "${_output_path} /rust"
142
+ DESTINATION "share/${PROJECT_NAME} "
143
+ )
144
+ endif ()
176
145
177
146
if (BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS)
178
147
if (
0 commit comments