mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-20 22:05:37 +00:00
Merge pull request #2600 from libgit2/cmn/embed-ssh
Provide option to embed libssh2
This commit is contained in:
commit
a60d0f11f4
@ -26,6 +26,10 @@ v0.21 + 1
|
|||||||
as, so this introduces the USERNAME credential type which the ssh
|
as, so this introduces the USERNAME credential type which the ssh
|
||||||
transport will use to ask for the username.
|
transport will use to ask for the username.
|
||||||
|
|
||||||
|
* The build system now accepts an option EMBED_SSH_PATH which when set
|
||||||
|
tells it to include a copy of libssh2 at the given location. This is
|
||||||
|
enabled for MSVC.
|
||||||
|
|
||||||
* The git_transport_register function no longer takes a priority and takes
|
* The git_transport_register function no longer takes a priority and takes
|
||||||
a URL scheme name (eg "http") instead of a prefix like "http://"
|
a URL scheme name (eg "http") instead of a prefix like "http://"
|
||||||
|
|
||||||
|
@ -60,6 +60,10 @@ IF(MSVC)
|
|||||||
# HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument.
|
# HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument.
|
||||||
OPTION( WINHTTP "Use Win32 WinHTTP routines" ON )
|
OPTION( WINHTTP "Use Win32 WinHTTP routines" ON )
|
||||||
|
|
||||||
|
# If you want to embed a copy of libssh2 into libgit2, pass a
|
||||||
|
# path to libssh2
|
||||||
|
OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF )
|
||||||
|
|
||||||
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
|
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
@ -134,6 +138,13 @@ STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "$
|
|||||||
# Find required dependencies
|
# Find required dependencies
|
||||||
INCLUDE_DIRECTORIES(src include)
|
INCLUDE_DIRECTORIES(src include)
|
||||||
|
|
||||||
|
IF (WIN32 AND EMBED_SSH_PATH)
|
||||||
|
FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
|
||||||
|
INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include")
|
||||||
|
FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
|
||||||
|
ADD_DEFINITIONS(-DGIT_SSH)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF (WIN32 AND WINHTTP AND NOT MINGW)
|
IF (WIN32 AND WINHTTP AND NOT MINGW)
|
||||||
ADD_DEFINITIONS(-DGIT_WINHTTP)
|
ADD_DEFINITIONS(-DGIT_WINHTTP)
|
||||||
INCLUDE_DIRECTORIES(deps/http-parser)
|
INCLUDE_DIRECTORIES(deps/http-parser)
|
||||||
@ -393,7 +404,7 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Compile and link libgit2
|
# Compile and link libgit2
|
||||||
ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC})
|
ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
|
||||||
TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
|
||||||
TARGET_LINK_LIBRARIES(git2 ${SSH_LIBRARIES})
|
TARGET_LINK_LIBRARIES(git2 ${SSH_LIBRARIES})
|
||||||
TARGET_LINK_LIBRARIES(git2 ${GSSAPI_LIBRARIES})
|
TARGET_LINK_LIBRARIES(git2 ${GSSAPI_LIBRARIES})
|
||||||
@ -459,7 +470,7 @@ IF (BUILD_CLAR)
|
|||||||
${CLAR_PATH}/clar.c
|
${CLAR_PATH}/clar.c
|
||||||
PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite)
|
PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite)
|
||||||
|
|
||||||
ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1})
|
ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES})
|
||||||
TARGET_LINK_LIBRARIES(libgit2_clar ${SSH_LIBRARIES})
|
TARGET_LINK_LIBRARIES(libgit2_clar ${SSH_LIBRARIES})
|
||||||
|
Loading…
Reference in New Issue
Block a user