mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-10 18:28:16 +00:00
Merge pull request #1905 from libgit2/cmn/list-deps
Be explicit about dependencies
This commit is contained in:
commit
3fcb1d8311
@ -50,6 +50,15 @@ IF(MSVC)
|
|||||||
OPTION( STATIC_CRT "Link the static CRT libraries" ON )
|
OPTION( STATIC_CRT "Link the static CRT libraries" ON )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
# This variable will contain the libraries we need to put into
|
||||||
|
# libgit2.pc's Requires.private. That is, what we're linking to or
|
||||||
|
# what someone who's statically linking us needs to link to.
|
||||||
|
SET(LIBGIT2_PC_REQUIRES "")
|
||||||
|
# This will be set later if we use the system's http-parser library or
|
||||||
|
# use iconv (OSX) and will be written to the Libs.private field in the
|
||||||
|
# pc file.
|
||||||
|
SET(LIBGIT2_PC_LIBS "")
|
||||||
|
|
||||||
# Installation paths
|
# Installation paths
|
||||||
#
|
#
|
||||||
SET(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.")
|
SET(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.")
|
||||||
@ -68,6 +77,7 @@ FUNCTION(TARGET_OS_LIBRARIES target)
|
|||||||
IF(USE_ICONV)
|
IF(USE_ICONV)
|
||||||
TARGET_LINK_LIBRARIES(${target} iconv)
|
TARGET_LINK_LIBRARIES(${target} iconv)
|
||||||
ADD_DEFINITIONS(-DGIT_USE_ICONV)
|
ADD_DEFINITIONS(-DGIT_USE_ICONV)
|
||||||
|
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -liconv")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(THREADSAFE)
|
IF(THREADSAFE)
|
||||||
@ -119,6 +129,7 @@ ELSE ()
|
|||||||
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
||||||
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
|
||||||
LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
|
LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
|
||||||
|
SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lhttp_parser")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE("http-parser was not found or is too old; using bundled 3rd-party sources.")
|
MESSAGE("http-parser was not found or is too old; using bundled 3rd-party sources.")
|
||||||
INCLUDE_DIRECTORIES(deps/http-parser)
|
INCLUDE_DIRECTORIES(deps/http-parser)
|
||||||
@ -132,6 +143,7 @@ IF (WIN32 AND NOT MINGW AND NOT SHA1_TYPE STREQUAL "builtin")
|
|||||||
FILE(GLOB SRC_SHA1 src/hash/hash_win32.c)
|
FILE(GLOB SRC_SHA1 src/hash/hash_win32.c)
|
||||||
ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin")
|
ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin")
|
||||||
ADD_DEFINITIONS(-DOPENSSL_SHA1)
|
ADD_DEFINITIONS(-DOPENSSL_SHA1)
|
||||||
|
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
|
||||||
ELSE()
|
ELSE()
|
||||||
FILE(GLOB SRC_SHA1 src/hash/hash_generic.c)
|
FILE(GLOB SRC_SHA1 src/hash/hash_generic.c)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -154,6 +166,7 @@ FIND_PACKAGE(ZLIB QUIET)
|
|||||||
IF (ZLIB_FOUND)
|
IF (ZLIB_FOUND)
|
||||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
|
||||||
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
LINK_LIBRARIES(${ZLIB_LIBRARIES})
|
||||||
|
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
|
||||||
# Fake the message CMake would have shown
|
# Fake the message CMake would have shown
|
||||||
MESSAGE("-- Found zlib: ${ZLIB_LIBRARY}")
|
MESSAGE("-- Found zlib: ${ZLIB_LIBRARY}")
|
||||||
ELSE()
|
ELSE()
|
||||||
@ -169,6 +182,7 @@ ENDIF()
|
|||||||
IF (LIBSSH2_FOUND)
|
IF (LIBSSH2_FOUND)
|
||||||
ADD_DEFINITIONS(-DGIT_SSH)
|
ADD_DEFINITIONS(-DGIT_SSH)
|
||||||
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
|
||||||
|
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2")
|
||||||
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
|
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
11
README.md
11
README.md
@ -43,6 +43,17 @@ and also powering Microsoft's Visual Studio tools for Git. The library provides
|
|||||||
* descriptive and detailed error messages
|
* descriptive and detailed error messages
|
||||||
* ...and more (over 175 different API calls)
|
* ...and more (over 175 different API calls)
|
||||||
|
|
||||||
|
Optional dependencies
|
||||||
|
=====================
|
||||||
|
|
||||||
|
While the library provides git functionality without the need for
|
||||||
|
dependencies, it can make use of a few libraries to add to it:
|
||||||
|
|
||||||
|
- pthreads (non-Windows) to enable threadsafe access as well as multi-threaded pack generation
|
||||||
|
- OpenSSL (non-Windows) to talk over HTTPS and provide the SHA-1 functions
|
||||||
|
- LibSSH2 to enable the ssh transport
|
||||||
|
- iconv (OSX) to handle the HFS+ path encoding peculiarities
|
||||||
|
|
||||||
Building libgit2 - Using CMake
|
Building libgit2 - Using CMake
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@
|
|||||||
Name: libgit2
|
Name: libgit2
|
||||||
Description: The git library, take 2
|
Description: The git library, take 2
|
||||||
Version: @LIBGIT2_VERSION_STRING@
|
Version: @LIBGIT2_VERSION_STRING@
|
||||||
Requires: libcrypto
|
Requires.private: @LIBGIT2_PC_REQUIRES@
|
||||||
Libs: -L${libdir} -lgit2 -lz -lcrypto
|
Libs.private: @LIBGIT2_PC_LIBS@
|
||||||
|
Libs: -L${libdir} -lgit2
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
|
Loading…
Reference in New Issue
Block a user