Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to rosidl_generate_interfaces to skip dependency export. #708

Merged

Conversation

clalancette
Copy link
Contributor

When a dependency is declared in rosidl_generate_interfaces(), ament_export_dependencies() for that dependency is automatically called. That is the correct default behavior, but it isn't always the behavior that is wanted. In particular, if a package has messages that are only used for tests, we don't want to export those dependencies downstream. Add an option to skip dependency export for rosidl_generate_interfaces.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This came out of ros-tooling/libstatistics_collector#54 , and libstatistics_collector will be the first user of it.

When a dependency is declared in rosidl_generate_interfaces(),
ament_export_dependencies() for that dependency is automatically
called.  That is the correct default behavior, but it isn't always
the behavior that is wanted.  In particular, if a package has
messages that are only used for tests, we don't want to export
those dependencies downstream.  Add an option to skip dependency
export for rosidl_generate_interfaces.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

CI for this is over in ros-tooling/libstatistics_collector#145 (comment)

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should use the existing SKIP_INSTALL variable. It's already used to skip exporting targets, libraries, and dependencies in downstream generators.

https://github.com/ros2/rosidl_typesupport/blob/9fe935124b2a4f5c662f241850c03223855e8fc6/rosidl_typesupport_c/cmake/rosidl_typesupport_c_generate_interfaces.cmake#L140-L161

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

That's fair. Made that change in 9013e83; please take another look.

@clalancette
Copy link
Contributor Author

Latest CI for this is over in ros-tooling/libstatistics_collector#145 (comment) (and it is green). So going ahead and merging this; thanks for the review!

@clalancette clalancette merged commit 07c2920 into rolling Oct 4, 2022
@clalancette clalancette deleted the clalancette/add-option-to-skip-dependency-export branch October 4, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants