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

Remove -lhts from Libs.private in the pkg-config file. #1852

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

teo-tsirpanis
Copy link
Contributor

I noticed that htslib.pc.in specifies -lhts in both the Libs and the Libs.private fields. This causes problems when using HTSlib from vcpkg, because vcpkg merges the latter field with the former, resulting in Libs: "-L${libdir}" -lhts "-L${libdir}" -lhts -lhtscodecs "-L${prefix}/lib" -lm -lpthread. This causes CMake to remove the first -lhts, which causes link errors because of undefined symbols from htscodecs.

This PR fixes this by removing -lhts from Libs.private. According to my understanding of pkg-config the duplication in both Libs and Libs.private is redundant either way.

Validated locally.

@daviesrob daviesrob self-assigned this Oct 24, 2024
@daviesrob
Copy link
Member

This looks OK, as far as I can tell. In particular, pkg-config --static --libs output still includes -lhts and removes the duplicate.

The change adding -lhts to Libs.private turned up in the pull request that added the pkg-config file, but unfortunately there's no information about why it was put there. Without any information to the contrary, it looks like it should be safe to remove.

@daviesrob daviesrob merged commit d43c5f6 into samtools:develop Oct 28, 2024
9 checks passed
@teo-tsirpanis teo-tsirpanis deleted the libs-private branch October 28, 2024 11:44
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