Merge pull request #7215 from carlosmn/cmn/ssh2-pc-requires

camke: include libssh2 in `Requires.private` in the PC file
This commit is contained in:
Edward Thomson
2026-03-14 14:13:40 +00:00
committed by GitHub

View File

@@ -6,7 +6,9 @@ if(USE_SSH STREQUAL "exec")
elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
find_pkglibraries(LIBSSH2 libssh2)
if(NOT LIBSSH2_FOUND)
if(LIBSSH2_FOUND)
set(LIBSSH2_FOUND_PKGCONFIG 1)
else()
find_package(LibSSH2)
set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY)
@@ -20,7 +22,11 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
if(LIBSSH2_FOUND_PKGCONFIG)
list(APPEND LIBGIT2_PC_REQUIRES "libssh2")
else()
list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
endif()
check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
if(HAVE_LIBSSH2_MEMORY_CREDENTIALS)