Files
bun.sh/cmake/targets/BuildLibgit2.cmake
Sosuke Suzuki f02511d2f8 feat: add bun:git module with libgit2 integration
Adds a new built-in module for Git operations using libgit2 (v1.9.0) statically linked.
Initial implementation includes Repository.open(), head(), and Commit properties (id, message, summary, author, committer, time).
Designed for local-only operations with lazy initialization to avoid overhead for users who don't need Git functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:50:25 +09:00

41 lines
815 B
CMake

register_repository(
NAME
libgit2
REPOSITORY
libgit2/libgit2
TAG
v1.9.0
)
register_cmake_command(
TARGET
libgit2
TARGETS
libgit2package
ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTS=OFF
-DBUILD_CLI=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_FUZZERS=OFF
# Network disabled - local operations only
-DUSE_HTTPS=OFF
-DUSE_SSH=OFF
# Use bundled dependencies to avoid symbol conflicts with Bun's libraries
-DUSE_BUNDLED_ZLIB=ON
-DUSE_HTTP_PARSER=builtin
-DREGEX_BACKEND=builtin
-DUSE_SHA1=CollisionDetection
# Enable threading
-DUSE_THREADS=ON
# Disable authentication features (not needed for local operations)
-DUSE_GSSAPI=OFF
LIB_PATH
.
LIBRARIES
git2
INCLUDES
include
)