Skip to content

cmake: fix three issues generating lib options in config files#21654

Closed
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:cm-dash-pthread
Closed

cmake: fix three issues generating lib options in config files#21654
vszakats wants to merge 3 commits into
curl:masterfrom
vszakats:cm-dash-pthread

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented May 17, 2026

vszakats added 3 commits May 17, 2026 14:12
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
 ```
@vszakats vszakats added the cmake label May 17, 2026
@github-actions github-actions Bot added the build label May 17, 2026
@vszakats vszakats marked this pull request as draft May 17, 2026 13:25
@vszakats vszakats marked this pull request as ready for review May 17, 2026 13:35
@vszakats vszakats changed the title [WIP] cmake: fix config file generation issues cmake: fix three config file generation issues May 17, 2026
@vszakats vszakats changed the title cmake: fix three config file generation issues cmake: fix three issues generating lib options in config files May 17, 2026
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
@vszakats vszakats closed this in 3c597ce May 17, 2026
@vszakats vszakats deleted the cm-dash-pthread branch May 17, 2026 20:48
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant