Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
fdd06874
Commit
fdd06874
authored
Aug 09, 2017
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: use FeatureSummary to display which features we end up using
parent
99d6ebb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
CMakeLists.txt
+8
-0
src/CMakeLists.txt
+16
-0
No files found.
CMakeLists.txt
View file @
fdd06874
...
...
@@ -28,6 +28,7 @@ INCLUDE(CheckStructHasMember)
INCLUDE
(
AddCFlagIfSupported
)
INCLUDE
(
FindPkgConfig
)
INCLUDE
(
FindThreads
)
INCLUDE
(
FeatureSummary
)
# Build options
#
...
...
@@ -334,3 +335,10 @@ ENDIF ()
IF
(
BUILD_EXAMPLES
)
ADD_SUBDIRECTORY
(
examples
)
ENDIF
()
IF
(
CMAKE_VERSION VERSION_GREATER 3
)
FEATURE_SUMMARY
(
WHAT ENABLED_FEATURES DISABLED_FEATURES
)
ELSE
()
PRINT_ENABLED_FEATURES
()
PRINT_DISABLED_FEATURES
()
ENDIF
()
src/CMakeLists.txt
View file @
fdd06874
IF
(
DEBUG_POOL
)
SET
(
GIT_DEBUG_POOL 1
)
ENDIF
()
ADD_FEATURE_INFO
(
debugpool GIT_DEBUG_POOL
"debug pool allocator"
)
# Add the features.h file as a dummy. This is required for Xcode
# to successfully build the libgit2 library when using only
...
...
@@ -50,6 +51,7 @@ ENDIF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR})
IF
(
ENABLE_TRACE STREQUAL
"ON"
)
SET
(
GIT_TRACE 1
)
ENDIF
()
ADD_FEATURE_INFO
(
tracing GIT_TRACE
"tracing support"
)
CHECK_SYMBOL_EXISTS
(
regcomp_l
"regex.h;xlocale.h"
HAVE_REGCOMP_L
)
IF
(
HAVE_REGCOMP_L
)
...
...
@@ -93,6 +95,7 @@ IF(THREADSAFE)
LIST
(
APPEND LIBGIT2_LIBS
${
CMAKE_THREAD_LIBS_INIT
}
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
CMAKE_THREAD_LIBS_INIT
}
)
ENDIF
()
ADD_FEATURE_INFO
(
threadsafe THREADSAFE
"threadsafe support"
)
IF
(
SECURITY_FOUND
)
IF
(
SECURITY_HAS_SSLCREATECONTEXT
)
...
...
@@ -150,21 +153,26 @@ ELSE ()
LIST
(
APPEND LIBGIT2_LIBS
${
CURL_LIBRARIES
}
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
CURL_LDFLAGS
}
)
ENDIF
()
ADD_FEATURE_INFO
(
cURL GIT_CURL
"cURL for HTTP proxy support"
)
ENDIF
()
# Specify sha1 implementation
IF
(
USE_SHA1DC
)
ADD_FEATURE_INFO
(
SHA ON
"using SHA1DC"
)
SET
(
GIT_SHA1_COLLISIONDETECT 1
)
ADD_DEFINITIONS
(
-DSHA1DC_NO_STANDARD_INCLUDES=1
)
ADD_DEFINITIONS
(
-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\
"common.h
\"
)
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=
\"
common.h
\"
)
FILE(GLOB SRC_SHA1 hash/hash_collisiondetect.c hash/sha1dc/*)
ELSEIF (WIN32 AND NOT MINGW)
ADD_FEATURE_INFO(SHA ON "
using SHA1_WIN32
")
SET(GIT_SHA1_WIN32 1)
FILE(GLOB SRC_SHA1 hash/hash_win32.c)
ELSEIF (
${
CMAKE_SYSTEM_NAME
}
MATCHES "
Darwin
")
ADD_FEATURE_INFO(SHA ON "
using CommonCrypto
")
SET(GIT_SHA1_COMMON_CRYPTO 1)
ELSEIF (OPENSSL_FOUND)
ADD_FEATURE_INFO(SHA ON "
using OpenSSL
")
SET(GIT_SHA1_OPENSSL 1)
IF (CMAKE_SYSTEM_NAME MATCHES "
FreeBSD
")
LIST(APPEND LIBGIT2_PC_LIBS "
-lssl
")
...
...
@@ -172,6 +180,7 @@ ELSEIF (OPENSSL_FOUND)
SET(LIBGIT2_PC_REQUIRES "
${
LIBGIT2_PC_REQUIRES
}
openssl
")
ENDIF ()
ELSE()
ADD_FEATURE_INFO(SHA ON "
using generic
")
FILE(GLOB SRC_SHA1 hash/hash_generic.c)
ENDIF()
...
...
@@ -189,11 +198,13 @@ IF (USE_EXT_HTTP_PARSER AND HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUA
LIST(APPEND LIBGIT2_INCLUDES
${
HTTP_PARSER_INCLUDE_DIRS
}
)
LIST(APPEND LIBGIT2_LIBS
${
HTTP_PARSER_LIBRARIES
}
)
LIST(APPEND LIBGIT2_PC_LIBS "
-lhttp_parser
")
ADD_FEATURE_INFO(http-parser ON "
http-parser support
")
ELSE()
MESSAGE(STATUS "
http-parser version 2 was not found or disabled; using bundled 3rd-party sources.
")
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/http-parser
" "
${
libgit2_BINARY_DIR
}
/deps/http-parser
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/http-parser
")
LIST(APPEND LIBGIT2_OBJECTS "
$<TARGET_OBJECTS:http-parser>
")
ADD_FEATURE_INFO(http-parser ON "
http-parser
support
(
bundled
)
")
ENDIF()
# Optional external dependency: zlib
...
...
@@ -207,11 +218,13 @@ IF (ZLIB_FOUND)
ELSE()
SET(LIBGIT2_PC_REQUIRES "
${
LIBGIT2_PC_REQUIRES
}
zlib
")
ENDIF()
ADD_FEATURE_INFO(zlib ON "
Zlib support
")
ELSE()
MESSAGE(STATUS "
zlib was not found; using bundled 3rd-party sources.
" )
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/zlib
" "
${
libgit2_BINARY_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
ADD_FEATURE_INFO(zlib ON "
Zlib
support
(
bundled
)
")
ENDIF()
# Optional external dependency: libssh2
...
...
@@ -233,6 +246,7 @@ IF (LIBSSH2_FOUND)
ELSE()
MESSAGE(STATUS "
LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.
")
ENDIF()
ADD_FEATURE_INFO(SSH GIT_SSH "
SSH transport support
")
# Optional external dependency: libgssapi
IF (USE_GSSAPI)
...
...
@@ -242,6 +256,7 @@ IF (GSSAPI_FOUND)
SET(GIT_GSSAPI 1)
LIST(APPEND LIBGIT2_LIBS
${
GSSAPI_LIBRARIES
}
)
ENDIF()
ADD_FEATURE_INFO(SPNEGO GIT_GSSAPI "
SPNEGO authentication support
")
# Optional external dependency: iconv
IF (USE_ICONV)
...
...
@@ -253,6 +268,7 @@ IF (ICONV_FOUND)
LIST(APPEND LIBGIT2_LIBS
${
ICONV_LIBRARIES
}
)
LIST(APPEND LIBGIT2_PC_LIBS
${
ICONV_LIBRARIES
}
)
ENDIF()
ADD_FEATURE_INFO(iconv GIT_USE_ICONV "
iconv encoding conversion support
")
IF (SECURITY_FOUND)
SET(GIT_SECURE_TRANSPORT 1)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment