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

Link against _TARGETS #14

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Link against _TARGETS #14

merged 1 commit into from
Aug 23, 2023

Conversation

Yadunund
Copy link
Member

It turns out passing libraries to link in target_link_libraries() as ${foo_pkg_LIBRARIES} introduces a lot of duplicate of the same library that needs to be linked. This the reason why the ld linker takes a REALLY long time to finish linking since it does not de-duplicate the duplicate libraries and links all them. The lld linker seems to be smarter about this.

Switching to ${foo_pkg_TARGETS} prevents the duplicate libraries that were previously included as transitives. This is also the pattern that ROS 2 follows. See.

Signed-off-by: Yadunund <[email protected]>
@Yadunund Yadunund requested a review from koonpeng August 22, 2023 16:32
@Yadunund Yadunund merged commit 10f4944 into main Aug 23, 2023
2 checks passed
@Yadunund Yadunund deleted the yadu/improve_compile_time branch August 23, 2023 04:19
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.

2 participants