You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If only PUBLIC is allowed and it's used, I can only use public for all other dependencies, even for my PRIVATE library, which leads to a problem.
For example, visualization_msgs is my private library:
ament_target_dependencies(lanelet2_extension_lib PUBLIC
visualization_msgs
)
but if I don't call
ament_export_dependencies(visualization_msgs)
The user of my lib package will have this error:
The link interface of target "lanelet2_extension::lanelet2_extension_lib"
contains:
visualization_msgs::visualization_msgs__rosidl_generator_c
but the target was not found. Possible reasons include:
The text was updated successfully, but these errors were encountered:
Nowadays, INTERFACE is also allowed, but PRIVATE still isn't.
Overall, we are (slowly) moving away from ament_target_dependencies, and instead just use target_link_libraries everywhere. This is one of the reasons; target_link_libraries can do everything that we need, and more. So my suggestion is that for these private dependencies, you switch to using target_link_libraries instead, and then you won't have to export them to downstream consumers.
#161 (comment)
I'd like to know why?
If only PUBLIC is allowed and it's used, I can only use public for all other dependencies, even for my PRIVATE library, which leads to a problem.
For example,
visualization_msgs
is my private library:but if I don't call
The user of my lib package will have this error:
The text was updated successfully, but these errors were encountered: