Skip to content

Commit 2ee666d

Browse files
authored
Vanilla cURL 8.19.0
1 parent 135a7bf commit 2ee666d

1,246 files changed

Lines changed: 36811 additions & 40446 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMake/CurlSymbolHiding.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
2525
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
2626

27-
if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
27+
if(WIN32 AND ENABLE_DEBUG)
2828
# We need to export internal debug functions,
2929
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
3030
# so disable symbol hiding for debug builds and for memory tracking.

CMake/CurlTests.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <sys/types.h>
2828
#include <unistd.h>
2929
#include <fcntl.h>
30-
/* */
30+
3131
#if defined(sun) || defined(__sun__) || \
3232
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
3333
# if defined(__SVR4) || defined(__srv4__)
@@ -39,7 +39,7 @@
3939
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
4040
# define PLATFORM_AIX_V3
4141
#endif
42-
/* */
42+
4343
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
4444
#error "O_NONBLOCK does not work on this platform"
4545
#endif
@@ -128,7 +128,7 @@ int main(void)
128128
#ifdef HAVE_FILE_OFFSET_BITS
129129
#include <sys/types.h>
130130
/* Check that off_t can represent 2**63 - 1 correctly.
131-
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
131+
We cannot define LARGE_OFF_T to be 9223372036854775807,
132132
since some C++ compilers masquerading as C compilers
133133
incorrectly reject 9223372036854775807. */
134134
#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))

CMake/FindBrotli.cmake

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
29-
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
30-
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
28+
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
29+
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
30+
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
31+
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
3132
#
3233
# Defines:
3334
#
34-
# - `BROTLI_FOUND`: System has brotli.
35-
# - `BROTLI_VERSION`: Version of brotli.
36-
# - `CURL::brotli`: brotli library target.
35+
# - `BROTLI_FOUND`: System has brotli.
36+
# - `BROTLI_VERSION`: Version of brotli.
37+
# - `CURL::brotli`: brotli library target.
3738

3839
set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
3940

@@ -49,11 +50,22 @@ if(_brotli_FOUND)
4950
set(Brotli_FOUND TRUE)
5051
set(BROTLI_FOUND TRUE)
5152
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION})
53+
if(BROTLI_USE_STATIC_LIBS)
54+
set(_brotli_CFLAGS "${_brotli_STATIC_CFLAGS}")
55+
set(_brotli_INCLUDE_DIRS "${_brotli_STATIC_INCLUDE_DIRS}")
56+
set(_brotli_LIBRARY_DIRS "${_brotli_STATIC_LIBRARY_DIRS}")
57+
set(_brotli_LIBRARIES "${_brotli_STATIC_LIBRARIES}")
58+
endif()
5259
message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
5360
else()
5461
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
55-
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
56-
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
62+
if(BROTLI_USE_STATIC_LIBS)
63+
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon-static" "brotlicommon")
64+
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec-static" "brotlidec")
65+
else()
66+
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
67+
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
68+
endif()
5769

5870
include(FindPackageHandleStandardArgs)
5971
find_package_handle_standard_args(Brotli

CMake/FindCares.cmake

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
29-
# - `CARES_LIBRARY`: Absolute path to `cares` library.
28+
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
29+
# - `CARES_LIBRARY`: Absolute path to `cares` library.
30+
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
3031
#
3132
# Defines:
3233
#
33-
# - `CARES_FOUND`: System has c-ares.
34-
# - `CARES_VERSION`: Version of c-ares.
35-
# - `CURL::cares`: c-ares library target.
34+
# - `CARES_FOUND`: System has c-ares.
35+
# - `CARES_VERSION`: Version of c-ares.
36+
# - `CURL::cares`: c-ares library target.
3637

3738
set(_cares_pc_requires "libcares")
3839

@@ -47,10 +48,21 @@ if(_cares_FOUND)
4748
set(Cares_FOUND TRUE)
4849
set(CARES_FOUND TRUE)
4950
set(CARES_VERSION ${_cares_VERSION})
51+
if(CARES_USE_STATIC_LIBS)
52+
set(_cares_CFLAGS "${_cares_STATIC_CFLAGS}")
53+
set(_cares_INCLUDE_DIRS "${_cares_STATIC_INCLUDE_DIRS}")
54+
set(_cares_LIBRARY_DIRS "${_cares_STATIC_LIBRARY_DIRS}")
55+
set(_cares_LIBRARIES "${_cares_STATIC_LIBRARIES}")
56+
endif()
5057
message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
5158
else()
5259
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
53-
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
60+
if(CARES_USE_STATIC_LIBS)
61+
set(_cares_CFLAGS "-DCARES_STATICLIB")
62+
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares_static" "cares")
63+
else()
64+
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
65+
endif()
5466

5567
unset(CARES_VERSION CACHE)
5668
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")

CMake/FindGSS.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment)
28+
# - `GSS_ROOT_DIR`: Absolute path to the root installation of GSS. (also supported as environment)
2929
#
3030
# Defines:
3131
#
32-
# - `GSS_FOUND`: System has a GSS library.
33-
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
34-
# In case the library is found but no version info available it is set to "unknown"
35-
# - `CURL::gss`: GSS library target.
36-
# - CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected.
32+
# - `GSS_FOUND`: System has a GSS library.
33+
# - `GSS_VERSION`: This is set to version advertised by pkg-config or read from manifest.
34+
# In case the library is found but no version info available it is set to "unknown"
35+
# - `CURL::gss`: GSS library target.
36+
# - `CURL_GSS_FLAVOUR`: Custom property. "GNU" or "MIT" if detected.
3737

3838
set(_gnu_modname "gss")
3939
set(_mit_modname "mit-krb5-gssapi")

CMake/FindLibssh.cmake

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory.
29-
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library.
28+
# - `LIBSSH_INCLUDE_DIR`: Absolute path to libssh include directory.
29+
# - `LIBSSH_LIBRARY`: Absolute path to `libssh` library.
30+
# - `LIBSSH_USE_STATIC_LIBS`: Configure for static libssh libraries.
3031
#
3132
# Defines:
3233
#
33-
# - `LIBSSH_FOUND`: System has libssh.
34-
# - `LIBSSH_VERSION`: Version of libssh.
35-
# - `CURL::libssh`: libssh library target.
34+
# - `LIBSSH_FOUND`: System has libssh.
35+
# - `LIBSSH_VERSION`: Version of libssh.
36+
# - `CURL::libssh`: libssh library target.
3637

3738
set(_libssh_pc_requires "libssh")
3839

@@ -47,10 +48,21 @@ if(_libssh_FOUND)
4748
set(Libssh_FOUND TRUE)
4849
set(LIBSSH_FOUND TRUE)
4950
set(LIBSSH_VERSION ${_libssh_VERSION})
51+
if(LIBSSH_USE_STATIC_LIBS)
52+
set(_libssh_CFLAGS "${_libssh_STATIC_CFLAGS}")
53+
set(_libssh_INCLUDE_DIRS "${_libssh_STATIC_INCLUDE_DIRS}")
54+
set(_libssh_LIBRARY_DIRS "${_libssh_STATIC_LIBRARY_DIRS}")
55+
set(_libssh_LIBRARIES "${_libssh_STATIC_LIBRARIES}")
56+
endif()
5057
message(STATUS "Found Libssh (via pkg-config): ${_libssh_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
5158
else()
5259
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
53-
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
60+
if(LIBSSH_USE_STATIC_LIBS)
61+
set(_libssh_CFLAGS "-DLIBSSH_STATIC")
62+
find_library(LIBSSH_LIBRARY NAMES "ssh_static" "libssh_static" "ssh" "libssh")
63+
else()
64+
find_library(LIBSSH_LIBRARY NAMES "ssh" "libssh")
65+
endif()
5466

5567
unset(LIBSSH_VERSION CACHE)
5668
if(LIBSSH_INCLUDE_DIR AND EXISTS "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")

CMake/FindLibssh2.cmake

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory.
29-
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library.
28+
# - `LIBSSH2_INCLUDE_DIR`: Absolute path to libssh2 include directory.
29+
# - `LIBSSH2_LIBRARY`: Absolute path to `libssh2` library.
30+
# - `LIBSSH2_USE_STATIC_LIBS`: Configure for static libssh2 libraries.
3031
#
3132
# Defines:
3233
#
33-
# - `LIBSSH2_FOUND`: System has libssh2.
34-
# - `LIBSSH2_VERSION`: Version of libssh2.
35-
# - `CURL::libssh2`: libssh2 library target.
34+
# - `LIBSSH2_FOUND`: System has libssh2.
35+
# - `LIBSSH2_VERSION`: Version of libssh2.
36+
# - `CURL::libssh2`: libssh2 library target.
3637

3738
set(_libssh2_pc_requires "libssh2")
3839

@@ -47,10 +48,20 @@ if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS)
4748
set(Libssh2_FOUND TRUE)
4849
set(LIBSSH2_FOUND TRUE)
4950
set(LIBSSH2_VERSION ${_libssh2_VERSION})
51+
if(LIBSSH2_USE_STATIC_LIBS)
52+
set(_libssh2_CFLAGS "${_libssh2_STATIC_CFLAGS}")
53+
set(_libssh2_INCLUDE_DIRS "${_libssh2_STATIC_INCLUDE_DIRS}")
54+
set(_libssh2_LIBRARY_DIRS "${_libssh2_STATIC_LIBRARY_DIRS}")
55+
set(_libssh2_LIBRARIES "${_libssh2_STATIC_LIBRARIES}")
56+
endif()
5057
message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
5158
else()
5259
find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h")
53-
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
60+
if(LIBSSH2_USE_STATIC_LIBS)
61+
find_library(LIBSSH2_LIBRARY NAMES "ssh2_static" "libssh2_static" "ssh2" "libssh2")
62+
else()
63+
find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2")
64+
endif()
5465

5566
unset(LIBSSH2_VERSION CACHE)
5667
if(LIBSSH2_INCLUDE_DIR AND EXISTS "${LIBSSH2_INCLUDE_DIR}/libssh2.h")

CMake/FindMbedTLS.cmake

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
29-
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
30-
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
31-
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
28+
# - `MBEDTLS_INCLUDE_DIR`: Absolute path to mbedTLS include directory.
29+
# - `MBEDTLS_LIBRARY`: Absolute path to `mbedtls` library.
30+
# - `MBEDX509_LIBRARY`: Absolute path to `mbedx509` library.
31+
# - `MBEDCRYPTO_LIBRARY`: Absolute path to `mbedcrypto` library.
32+
# - `MBEDTLS_USE_STATIC_LIBS`: Configure for static mbedTLS libraries.
3233
#
3334
# Defines:
3435
#
35-
# - `MBEDTLS_FOUND`: System has mbedTLS.
36-
# - `MBEDTLS_VERSION`: Version of mbedTLS.
37-
# - `CURL::mbedtls`: mbedTLS library target.
36+
# - `MBEDTLS_FOUND`: System has mbedTLS.
37+
# - `MBEDTLS_VERSION`: Version of mbedTLS.
38+
# - `CURL::mbedtls`: mbedTLS library target.
3839

3940
if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
4041
message(WARNING "MBEDTLS_INCLUDE_DIRS is deprecated, use MBEDTLS_INCLUDE_DIR instead.")
@@ -57,14 +58,27 @@ if(_mbedtls_FOUND)
5758
set(MbedTLS_FOUND TRUE)
5859
set(MBEDTLS_FOUND TRUE)
5960
set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION})
61+
if(MBEDTLS_USE_STATIC_LIBS)
62+
set(_mbedtls_CFLAGS "${_mbedtls_STATIC_CFLAGS}")
63+
set(_mbedtls_INCLUDE_DIRS "${_mbedtls_STATIC_INCLUDE_DIRS}")
64+
set(_mbedtls_LIBRARY_DIRS "${_mbedtls_STATIC_LIBRARY_DIRS}")
65+
set(_mbedtls_LIBRARIES "${_mbedtls_STATIC_LIBRARIES}")
66+
endif()
6067
message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
6168
else()
6269
set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config
6370

6471
find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h")
65-
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
66-
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
67-
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto")
72+
if(MBEDTLS_USE_STATIC_LIBS)
73+
find_library(MBEDTLS_LIBRARY NAMES "mbedtls_static" "libmbedtls_static" "mbedtls" "libmbedtls")
74+
find_library(MBEDX509_LIBRARY NAMES "mbedx509_static" "libmbedx509_static" "mbedx509" "libmbedx509")
75+
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto_static" "libmbedcrypto_static" "mbedcrypto" "libmbedcrypto"
76+
"tfpsacrypto_static" "libtfpsacrypto_static" "tfpsacrypto" "libtfpsacrypto")
77+
else()
78+
find_library(MBEDTLS_LIBRARY NAMES "mbedtls" "libmbedtls")
79+
find_library(MBEDX509_LIBRARY NAMES "mbedx509" "libmbedx509")
80+
find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" "libmbedcrypto" "tfpsacrypto" "libtfpsacrypto")
81+
endif()
6882

6983
unset(MBEDTLS_VERSION CACHE)
7084
if(MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")

CMake/FindNGHTTP2.cmake

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory.
29-
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library.
28+
# - `NGHTTP2_INCLUDE_DIR`: Absolute path to nghttp2 include directory.
29+
# - `NGHTTP2_LIBRARY`: Absolute path to `nghttp2` library.
30+
# - `NGHTTP2_USE_STATIC_LIBS`: Configure for static nghttp2 libraries.
3031
#
3132
# Defines:
3233
#
33-
# - `NGHTTP2_FOUND`: System has nghttp2.
34-
# - `NGHTTP2_VERSION`: Version of nghttp2.
35-
# - `CURL::nghttp2`: nghttp2 library target.
34+
# - `NGHTTP2_FOUND`: System has nghttp2.
35+
# - `NGHTTP2_VERSION`: Version of nghttp2.
36+
# - `CURL::nghttp2`: nghttp2 library target.
3637

3738
set(_nghttp2_pc_requires "libnghttp2")
3839

@@ -46,10 +47,21 @@ endif()
4647
if(_nghttp2_FOUND)
4748
set(NGHTTP2_FOUND TRUE)
4849
set(NGHTTP2_VERSION ${_nghttp2_VERSION})
50+
if(NGHTTP2_USE_STATIC_LIBS)
51+
set(_nghttp2_CFLAGS "${_nghttp2_STATIC_CFLAGS}")
52+
set(_nghttp2_INCLUDE_DIRS "${_nghttp2_STATIC_INCLUDE_DIRS}")
53+
set(_nghttp2_LIBRARY_DIRS "${_nghttp2_STATIC_LIBRARY_DIRS}")
54+
set(_nghttp2_LIBRARIES "${_nghttp2_STATIC_LIBRARIES}")
55+
endif()
4956
message(STATUS "Found NGHTTP2 (via pkg-config): ${_nghttp2_INCLUDE_DIRS} (found version \"${NGHTTP2_VERSION}\")")
5057
else()
5158
find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h")
52-
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
59+
if(NGHTTP2_USE_STATIC_LIBS)
60+
set(_nghttp2_CFLAGS "-DNGHTTP2_STATICLIB")
61+
find_library(NGHTTP2_LIBRARY NAMES "nghttp2_static" "nghttp2")
62+
else()
63+
find_library(NGHTTP2_LIBRARY NAMES "nghttp2" "nghttp2_static")
64+
endif()
5365

5466
unset(NGHTTP2_VERSION CACHE)
5567
if(NGHTTP2_INCLUDE_DIR AND EXISTS "${NGHTTP2_INCLUDE_DIR}/nghttp2/nghttp2ver.h")

CMake/FindNGHTTP3.cmake

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory.
29-
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library.
28+
# - `NGHTTP3_INCLUDE_DIR`: Absolute path to nghttp3 include directory.
29+
# - `NGHTTP3_LIBRARY`: Absolute path to `nghttp3` library.
30+
# - `NGHTTP3_USE_STATIC_LIBS`: Configure for static nghttp3 libraries.
3031
#
3132
# Defines:
3233
#
33-
# - `NGHTTP3_FOUND`: System has nghttp3.
34-
# - `NGHTTP3_VERSION`: Version of nghttp3.
35-
# - `CURL::nghttp3`: nghttp3 library target.
34+
# - `NGHTTP3_FOUND`: System has nghttp3.
35+
# - `NGHTTP3_VERSION`: Version of nghttp3.
36+
# - `CURL::nghttp3`: nghttp3 library target.
3637

3738
set(_nghttp3_pc_requires "libnghttp3")
3839

@@ -46,10 +47,21 @@ endif()
4647
if(_nghttp3_FOUND)
4748
set(NGHTTP3_FOUND TRUE)
4849
set(NGHTTP3_VERSION ${_nghttp3_VERSION})
50+
if(NGHTTP3_USE_STATIC_LIBS)
51+
set(_nghttp3_CFLAGS "${_nghttp3_STATIC_CFLAGS}")
52+
set(_nghttp3_INCLUDE_DIRS "${_nghttp3_STATIC_INCLUDE_DIRS}")
53+
set(_nghttp3_LIBRARY_DIRS "${_nghttp3_STATIC_LIBRARY_DIRS}")
54+
set(_nghttp3_LIBRARIES "${_nghttp3_STATIC_LIBRARIES}")
55+
endif()
4956
message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")")
5057
else()
5158
find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h")
52-
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
59+
if(NGHTTP3_USE_STATIC_LIBS)
60+
set(_nghttp3_CFLAGS "-DNGHTTP3_STATICLIB")
61+
find_library(NGHTTP3_LIBRARY NAMES "nghttp3_static" "nghttp3")
62+
else()
63+
find_library(NGHTTP3_LIBRARY NAMES "nghttp3")
64+
endif()
5365

5466
unset(NGHTTP3_VERSION CACHE)
5567
if(NGHTTP3_INCLUDE_DIR AND EXISTS "${NGHTTP3_INCLUDE_DIR}/nghttp3/version.h")

0 commit comments

Comments
 (0)