1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- find_package (rmw_implementation_cmake REQUIRED)
16- find_package (rmw REQUIRED)
17-
1815if (NOT WIN32 )
1916 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
2017 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
@@ -23,17 +20,8 @@ if(NOT WIN32)
2320 endif ()
2421endif ()
2522
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-
3423set (_output_path
3524 "${CMAKE_CURRENT_BINARY_DIR} /rosidl_generator_rs/${PROJECT_NAME} " )
36- set (_generated_extension_files "" )
3725set (_generated_common_rs_files "" )
3826
3927set (_generated_msg_rs_files "" )
@@ -42,10 +30,6 @@ set(_generated_srv_rs_files "")
4230set (_has_msg FALSE )
4331set (_has_srv FALSE )
4432
45- foreach (_typesupport_impl ${_typesupport_impls} )
46- set (_generated_extension_${_typesupport_impl} _files "" )
47- endforeach ()
48-
4933foreach (_idl_file ${rosidl_generate_interfaces_ABS_IDL_FILES} )
5034 get_filename_component (_parent_folder "${_idl_file} " DIRECTORY )
5135 get_filename_component (_parent_folder "${_parent_folder} " NAME )
@@ -75,22 +59,12 @@ if(${_has_msg})
7559 list (APPEND _generated_msg_rs_files
7660 "${_output_path} /rust/src/msg.rs"
7761 )
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 ()
8362endif ()
8463
8564if (${_has_srv} )
8665 list (APPEND _generated_srv_rs_files
8766 "${_output_path} /rust/src/srv.rs"
8867 )
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 ()
9468endif ()
9569
9670set (_dependency_files "" )
@@ -156,23 +130,18 @@ add_dependencies(${rosidl_generate_interfaces_TARGET} ${rosidl_generate_interfac
156130
157131set_property (
158132 SOURCE
159- ${_generated_extension_files}
160133 ${_generated_common_rs_files}
161134 ${_generated_msg_rs_files}
162135 ${_generated_srv_rs_files}
163136 PROPERTY GENERATED 1)
164137
165138set (_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 ()
176145
177146if (BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS)
178147 if (
0 commit comments