From: Viktor Szakats Date: Tue, 20 Aug 2024 21:10:31 +0000 (+0200) Subject: build: add `iphlpapi` lib for libssh on Windows X-Git-Tag: curl-8_10_0~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3065f106e3aba67552c8577004c4baed44f317f4;p=thirdparty%2Fcurl.git build: add `iphlpapi` lib for libssh on Windows vcpkg doesn't need it because it fixes this with a libssh patch. All other Windows builds need it. (autotools build not tested.) Closes #14618 --- diff --git a/CMake/FindLibssh.cmake b/CMake/FindLibssh.cmake index a9cb0f5ac7..e9c55f1597 100644 --- a/CMake/FindLibssh.cmake +++ b/CMake/FindLibssh.cmake @@ -87,3 +87,7 @@ else() mark_as_advanced(LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY) endif() + +if(LIBSSH_FOUND AND WIN32) + list(APPEND LIBSSH_LIBRARIES "iphlpapi") # for if_nametoindex +endif() diff --git a/configure.ac b/configure.ac index da636b446b..a6fe3e955e 100644 --- a/configure.ac +++ b/configure.ac @@ -2348,6 +2348,10 @@ elif test X"$OPT_LIBSSH" != Xno; then fi if test "$LIBSSH_ENABLED" = "1"; then + if test "$curl_cv_native_windows" = "yes"; then + dnl for if_nametoindex + LIBS="-liphlpapi $LIBS" + fi if test -n "$DIR_SSH"; then dnl when the libssh shared libs were found in a path that the run-time dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH