cmake: fix three issues generating lib options in config files#21654
Closed
vszakats wants to merge 3 commits into
Closed
cmake: fix three issues generating lib options in config files#21654vszakats wants to merge 3 commits into
vszakats wants to merge 3 commits into
Conversation
Logic copied from libssh2. For example: ``` -Libs.private: -lssh2 -lz -lz -lldap -llber -lssl -lcrypto -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace +Libs.private: -lssh2 -lz -lldap -llber -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace ```
Trying to fix: ``` Libs.private: -lz -l-pthread ``` Ref: https://github.com/curl/curl/actions/runs/25989536476/job/76393052390#step:6:30
vszakats
added a commit
to libssh2/libssh2
that referenced
this pull request
May 17, 2026
- cmake: fix potential non-lib option prefixed with `-l`, resulting in e.g. `-l-pthread`. Ref: curl/curl#21654 - omit zlib pkg-config reference for Android. Android does not offer a `zlib.pc` pkg-config file. Refs: curl/curl@7bde6cb curl/curl#21648 Closes #1946
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
- drop duplicate libs lists next to each other in `libcurl.pc`. Logic copied from libssh2. Fixing (seen in a local build): ```diff -Libs.private: -lssh2 -lz -lz -lldap -llber -lssl -lcrypto -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace +Libs.private: -lssh2 -lz -lldap -llber -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace ``` Refs: libssh2/libssh2@e1da7b2 libssh2/libssh2#1621 libssh2/libssh2@6464301 libssh2/libssh2#1131 - handle `$<LINK_ONLY:NAMESPACE::NAME>` references. Fixing (seen in a local build using libssh2 v1.11.2-DEV): ```diff -Libs.private: -lssh2 -l$<LINK_ONLY:OpenSSL::Crypto> -lz -lldap -llber [...] +Libs.private: -lssh2 -lcrypto -lz -lldap -llber [...] ``` - fix `-l-pthread` sneaking into `libcurl.pc`. Fixing (seen with Android): ```diff -Libs.private: -lz -l-pthread +Libs.private: -pthread -lz ``` Refs: https://github.com/microsoft/vcpkg/blob/2b65c20fc66eda893aa15a15a453c3cf09500b19/ports/curl/dependencies.patch#L631-L634 microsoft/vcpkg@70b941a#diff-7f2c3b2f93cd3478671a603cbd5ef818c7c403a11dc25e1d3539e9b03495a5d3 Upstream-patch-by: Kai Pastor Closes curl#21654
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
drop duplicate libs lists next to each other in
libcurl.pc.Logic copied from libssh2.
Fixing (seen in a local build):
Refs:
libssh2/libssh2@e1da7b2
cmake: de-duplicate
LIBSSH2_PC_LIBS_PRIVATEmore carefully libssh2/libssh2#1621libssh2/libssh2@6464301
cmake: (re-)add zlib to
Libs.privateinlibssh2.pclibssh2/libssh2#1131handle
$<LINK_ONLY:NAMESPACE::NAME>references.Fixing (seen in a local build using libssh2 v1.11.2-DEV):
fix
-l-pthreadsneaking intolibcurl.pc.Fixing (seen with Android):
Refs:
https://github.com/microsoft/vcpkg/blob/2b65c20fc66eda893aa15a15a453c3cf09500b19/ports/curl/dependencies.patch#L631-L634
microsoft/vcpkg@70b941a#diff-7f2c3b2f93cd3478671a603cbd5ef818c7c403a11dc25e1d3539e9b03495a5d3
Upstream-patch-by: Kai Pastor