]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix nghttp3 static linking with `USE_OPENSSL_QUIC=ON`
authorbruce.yoon(윤병조)/kakao <bruce.yoon@kakaocorp.com>
Thu, 10 Apr 2025 06:22:06 +0000 (15:22 +0900)
committerViktor Szakats <commit@vsz.me>
Sat, 12 Apr 2025 18:58:51 +0000 (20:58 +0200)
Though cmake finds nghttp3 by pkg-config, nghttp3 isn't linked properly.
Because library directory is not given by -L.

Closes #17010

CMakeLists.txt

index 330eca66369feba6716d70501e545e2166b5472e..df23fab2405054c21e91011d42dacfcd50d345f0 100644 (file)
@@ -1230,9 +1230,14 @@ if(USE_OPENSSL_QUIC)
 
   find_package(NGHTTP3 REQUIRED)
   set(USE_NGHTTP3 ON)
-  include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS})
   list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES})
+  list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS})
   list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES})
+  include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS})
+  link_directories(${NGHTTP3_LIBRARY_DIRS})
+  if(NGHTTP3_CFLAGS)
+    string(APPEND CMAKE_C_FLAGS " ${NGHTTP3_CFLAGS}")
+  endif()
 endif()
 
 if(CURL_WITH_MULTI_SSL AND (USE_NGTCP2 OR USE_QUICHE OR USE_MSH3 OR USE_OPENSSL_QUIC))