8000 Allow consumers to query the "backends" that libgit2 was built with by ethomson · Pull Request #6971 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Allow consumers to query the "backends" that libgit2 was built with #6971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
zlib: add zlib backend status to git2_features.h
Add the status of the zlib backend (builtin or external) to
`git2_features.h`.
  • Loading branch information
ethomson committed Dec 22, 2024
commit e0c255dbd68efaf69f0d013332629547bee84f1b
4 changes: 4 additions & 0 deletions cmake/SelectZlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include(SanitizeBool)
SanitizeBool(USE_BUNDLED_ZLIB)
if(USE_BUNDLED_ZLIB STREQUAL ON)
set(USE_BUNDLED_ZLIB "Bundled")
set(GIT_COMPRESSION_BUILTIN)
endif()

if(USE_BUNDLED_ZLIB STREQUAL "OFF")
Expand All @@ -17,6 +18,7 @@ if(USE_BUNDLED_ZLIB STREQUAL "OFF")
list(APPEND LIBGIT2_PC_REQUIRES "zlib")
endif()
add_feature_info(zlib ON "using system zlib")
set(GIT_COMPRESSION_ZLIB 1)
else()
message(STATUS "zlib was not found; using bundled 3rd-party sources." )
endif()
Expand All @@ -26,9 +28,11 @@ if(USE_BUNDLED_ZLIB STREQUAL "Chromium")
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/chromium-zlib")
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS $<TARGET_OBJECTS:chromium_zlib>)
add_feature_info(zlib ON "using (Chromium) bundled zlib")
set(GIT_COMPRESSION_BUILTIN 1)
elseif(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/zlib" "${PROJECT_BINARY_DIR}/deps/zlib")
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/zlib")
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS $<TARGET_OBJECTS:zlib>)
add_feature_info(zlib ON "using bundled zlib")
set(GIT_COMPRESSION_BUILTIN 1)
endif()
3 changes: 3 additions & 0 deletions src/util/git2_features.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
#cmakedefine GIT_SHA256_OPENSSL_DYNAMIC 1
#cmakedefine GIT_SHA256_MBEDTLS 1

#cmakedefine GIT_COMPRESSION_BUILTIN 1
#cmakedefine GIT_COMPRESSION_ZLIB 1

#cmakedefine GIT_RAND_GETENTROPY 1
#cmakedefine GIT_RAND_GETLOADAVG 1

Expand Down
0