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
46e1dabb
Unverified
Commit
46e1dabb
authored
Nov 11, 2017
by
Edward Thomson
Committed by
GitHub
Nov 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4403 from hkleynhans/select_bundled_zlib
cmake: Allow user to select bundled zlib
parents
0393ecc6
a0b0b808
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
CMakeLists.txt
+1
-0
src/CMakeLists.txt
+16
-12
No files found.
CMakeLists.txt
View file @
46e1dabb
...
@@ -55,6 +55,7 @@ OPTION( ENABLE_WERROR "Enable compilation with -Werror" OFF )
...
@@ -55,6 +55,7 @@ OPTION( ENABLE_WERROR "Enable compilation with -Werror" OFF )
IF
(
UNIX AND NOT APPLE
)
IF
(
UNIX AND NOT APPLE
)
OPTION
(
ENABLE_REPRODUCIBLE_BUILDS
"Enable reproducible builds"
OFF
)
OPTION
(
ENABLE_REPRODUCIBLE_BUILDS
"Enable reproducible builds"
OFF
)
ENDIF
()
ENDIF
()
OPTION
(
USE_BUNDLED_ZLIB
"Use the bundled version of zlib"
OFF
)
IF
(
MSVC
)
IF
(
MSVC
)
# This option is only available when building with MSVC. By default, libgit2
# This option is only available when building with MSVC. By default, libgit2
...
...
src/CMakeLists.txt
View file @
46e1dabb
...
@@ -255,23 +255,27 @@ ELSE()
...
@@ -255,23 +255,27 @@ ELSE()
ENDIF()
ENDIF()
# Optional external dependency: zlib
# Optional external dependency: zlib
FIND_PACKAGE(ZLIB)
IF(NOT USE_BUNDLED_ZLIB)
IF (ZLIB_FOUND)
FIND_PACKAGE(ZLIB)
LIST(APPEND LIBGIT2_INCLUDES
${
ZLIB_INCLUDE_DIRS
}
)
IF(ZLIB_FOUND)
LIST(APPEND LIBGIT2_LIBS
${
ZLIB_LIBRARIES
}
)
LIST(APPEND LIBGIT2_INCLUDES
${
ZLIB_INCLUDE_DIRS
}
)
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "
FreeBSD
")
LIST(APPEND LIBGIT2_LIBS
${
ZLIB_LIBRARIES
}
)
LIST(APPEND LIBGIT2_LIBS "
z
")
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "
FreeBSD
")
LIST(APPEND LIBGIT2_PC_LIBS "
-lz
")
LIST(APPEND LIBGIT2_LIBS "
z
")
LIST(APPEND LIBGIT2_PC_LIBS "
-lz
")
ELSE()
SET(LIBGIT2_PC_REQUIRES "
${
LIBGIT2_PC_REQUIRES
}
zlib
")
ENDIF()
ADD_FEATURE_INFO(zlib ON "
using system zlib
")
ELSE()
ELSE()
SET(LIBGIT2_PC_REQUIRES "
${
LIBGIT2_PC_REQUIRES
}
zlib
"
)
MESSAGE(STATUS "
zlib was not found; using bundled 3rd-party sources.
"
)
ENDIF()
ENDIF()
ADD_FEATURE_INFO(zlib ON "
Zlib support
")
ENDIF()
ELSE()
IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
MESSAGE(STATUS "
zlib was not found; using bundled 3rd-party sources.
" )
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/zlib
" "
${
libgit2_BINARY_DIR
}
/deps/zlib
")
ADD_SUBDIRECTORY("
${
libgit2_SOURCE_DIR
}
/deps/zlib
" "
${
libgit2_BINARY_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_INCLUDES "
${
libgit2_SOURCE_DIR
}
/deps/zlib
")
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
ADD_FEATURE_INFO(zlib ON "
Zlib
support
(
bundled
)
")
ADD_FEATURE_INFO(zlib ON "
using bundled zlib
")
ENDIF()
ENDIF()
# Optional external dependency: libssh2
# Optional external dependency: libssh2
...
...
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