mirror of
https://github.com/curl/curl.git
synced 2026-04-23 11:22:15 +03:00
cmake: add native pkg-config detection for mbedTLS, MSH3, Quiche, Rustls, wolfSSL
Also:
- detect and add required system libraries for Rustls on macOS and
non-Windows.
- add Linux CMake jobs for the touched dependencies.
Caveats:
- MSH3 generates a broken `libmsh3.pc`, so needs manual config.
Upstream PR: https://github.com/nibanks/msh3/pull/225
- Rustls `.pc` file missing, so needs manual config.
An internal change worthy of mention is that we are using the lib path
and name information returned by `pkg-config` as-is. Meaning the libname
doesn't include the full path, like it's usual with native cmake
detection. The path comes separately and needs to be rolled separately.
For this we add it to targets via `link_directories()`. We also keep tab
of them in `CURL_LIBDIRS` and use that in `libcurl.pc`. Feature checks
also need to receive these paths. CMake doesn't offer
a `CMAKE_REQUIRED_*` variable for this purpose, only
a `CMAKE_REQUIRED_LINK_OPTIONS` accepting raw linker flags. Add a macro
to convert a list of paths to linker options to solve it. wolfSSL
requires this for now.
Closes #15193
This commit is contained in:
parent
ae5351696f
commit
7bab201abe
9 changed files with 282 additions and 198 deletions
31
.github/workflows/http3-linux.yml
vendored
31
.github/workflows/http3-linux.yml
vendored
|
|
@ -261,29 +261,40 @@ jobs:
|
|||
matrix:
|
||||
build:
|
||||
- name: quictls
|
||||
PKG_CONFIG_PATH: '$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
|
||||
configure: >-
|
||||
PKG_CONFIG_PATH="$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib"
|
||||
LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib"
|
||||
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm
|
||||
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
|
||||
--with-openssl=$HOME/quictls/build
|
||||
|
||||
- name: gnutls
|
||||
PKG_CONFIG_PATH: '$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
|
||||
configure: >-
|
||||
PKG_CONFIG_PATH="$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/gnutls/build/lib"
|
||||
LDFLAGS="-Wl,-rpath,$HOME/gnutls/build/lib"
|
||||
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
|
||||
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
|
||||
--with-gnutls=$HOME/gnutls/build
|
||||
|
||||
- name: wolfssl
|
||||
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
|
||||
configure: >-
|
||||
PKG_CONFIG_PATH="$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/wolfssl/build/lib"
|
||||
LDFLAGS="-Wl,-rpath,$HOME/wolfssl/build/lib"
|
||||
--with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
|
||||
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
|
||||
--with-wolfssl=$HOME/wolfssl/build
|
||||
|
||||
- name: wolfssl
|
||||
PKG_CONFIG_PATH: '$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig'
|
||||
generate: >-
|
||||
-DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON -DENABLE_DEBUG=ON
|
||||
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
|
||||
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
|
||||
|
||||
- name: openssl-quic
|
||||
PKG_CONFIG_PATH: '$HOME/openssl3/build/lib64/pkgconfig'
|
||||
configure: >-
|
||||
PKG_CONFIG_PATH="$HOME/openssl3/build/lib64/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/openssl3/build/lib64"
|
||||
LDFLAGS="-Wl,-rpath,$HOME/openssl3/build/lib64"
|
||||
--enable-warnings --enable-werror --enable-debug --disable-ntlm
|
||||
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
|
||||
--with-openssl=$HOME/openssl3/build --with-openssl-quic
|
||||
|
|
@ -298,6 +309,15 @@ jobs:
|
|||
--with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
|
||||
--with-ca-fallback
|
||||
|
||||
- name: quiche
|
||||
PKG_CONFIG_PATH: '$HOME/quiche/target/release'
|
||||
generate: >-
|
||||
-DOPENSSL_ROOT_DIR=$HOME/quiche/quiche/deps/boringssl/src -DENABLE_DEBUG=ON
|
||||
-DUSE_QUICHE=ON
|
||||
-DTEST_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
|
||||
-DHTTPD_NGHTTPX="$HOME/nghttp2/build/bin/nghttpx"
|
||||
-DCURL_CA_FALLBACK=ON
|
||||
|
||||
steps:
|
||||
- run: |
|
||||
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
|
||||
|
|
@ -460,6 +480,9 @@ jobs:
|
|||
|
||||
- name: 'configure'
|
||||
run: |
|
||||
if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then
|
||||
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
|
||||
fi
|
||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||
cmake -B . -G Ninja \
|
||||
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
|
||||
|
|
|
|||
21
.github/workflows/linux.yml
vendored
21
.github/workflows/linux.yml
vendored
|
|
@ -113,6 +113,12 @@ jobs:
|
|||
install_steps: mbedtls
|
||||
configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/mbedtls/lib" --with-mbedtls=$HOME/mbedtls --enable-debug
|
||||
|
||||
- name: mbedtls
|
||||
install_packages: libnghttp2-dev
|
||||
install_steps: mbedtls
|
||||
PKG_CONFIG_PATH: '$HOME/mbedtls/lib/pkgconfig' # Requires v3.6.0 or upper
|
||||
generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON
|
||||
|
||||
- name: mbedtls-pkg
|
||||
install_packages: libnghttp2-dev libmbedtls-dev
|
||||
generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_USE_PKGCONFIG=OFF
|
||||
|
|
@ -122,6 +128,12 @@ jobs:
|
|||
install_steps: quictls msh3
|
||||
configure: LDFLAGS="-Wl,-rpath,$HOME/msh3/lib -Wl,-rpath,$HOME/quictls/lib" --with-msh3=$HOME/msh3 --with-openssl=$HOME/quictls --enable-debug
|
||||
|
||||
- name: msh3
|
||||
install_packages: zlib1g-dev
|
||||
install_steps: quictls msh3 skipall
|
||||
PKG_CONFIG_PATH: '$HOME/msh3/lib/pkgconfig' # Broken as of v0.6.0
|
||||
generate: -DOPENSSL_ROOT_DIR=$HOME/quictls -DUSE_MSH3=ON -DMSH3_INCLUDE_DIR=$HOME/msh3/include -DMSH3_LIBRARY=$HOME/msh3/lib/libmsh3.so -DENABLE_DEBUG=ON
|
||||
|
||||
- name: awslc
|
||||
install_packages: zlib1g-dev
|
||||
install_steps: awslc
|
||||
|
|
@ -227,6 +239,12 @@ jobs:
|
|||
install_steps: rust rustls pytest
|
||||
configure: --with-rustls=$HOME/rustls --enable-debug
|
||||
|
||||
- name: rustls
|
||||
install_packages: libpsl-dev
|
||||
install_steps: rust rustls skipall
|
||||
PKG_CONFIG_PATH: '$HOME/rustls/lib/pkgconfig' # Not built as of v0.14.0
|
||||
generate: -DCURL_USE_RUSTLS=ON -DRUSTLS_INCLUDE_DIR=$HOME/rustls/include -DRUSTLS_LIBRARY=$HOME/rustls/lib/librustls.a -DENABLE_DEBUG=ON
|
||||
|
||||
- name: IntelC !SSL
|
||||
install_packages: zlib1g-dev
|
||||
install_steps: intel
|
||||
|
|
@ -570,6 +588,9 @@ jobs:
|
|||
- name: 'configure'
|
||||
run: |
|
||||
[[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt remove --yes libssl-dev
|
||||
if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then
|
||||
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
|
||||
fi
|
||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||
cmake -B . -G Ninja \
|
||||
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue