feat: add option to export libraries as cmake targets #455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
EXPORT_LIBRARY_TARGETS
flag toament_auto_package()
macro.When the flag is provided, libraries are exported using their cmake target instead of going through ament home-made library export logic.
Although exporting libraries this way is stricter, it makes cmake invocations faster on downstream packages.
Example on Autoware's behavior path planner:
Before: 112s
After: 26s
Note: In my original experimentation, cmake time on this package went down to 17s. I have not checked exactly what is slowing things down yet.
ament_ex
macros are still way faster (8s on this package).This feature has been experimented on this autoware branch: autowarefoundation/autoware.universe@f3b6226
Note that this experimental branch also leverages extra macros that are not included in this PR, found here: 450b6de
See #453 for more details