Files
bun.sh/cmake/targets/BuildLibgit2.cmake
Claude Bot efeadc42b1 feat(bun:git): Initial implementation of bun:git module with libgit2
- Add libgit2 CMake build target
- Register bun:git native module
- Implement JSGitRepository class with:
  - Constructor and static find/init methods
  - Properties: path, gitDir, isBare, isClean, head, branch
  - Methods: getCommit, status, add, commit
- Implement JSGitCommit class with:
  - Properties: sha, shortSha, message, summary, author, committer, tree, parents
  - Methods: parent, isAncestorOf
- Implement JSGitBranch class with:
  - Properties: name, fullName, isRemote, isHead, commit, upstream, ahead, behind
  - Methods: delete, rename
- Implement JSGitSignature class with:
  - Properties: name, email, date, timezone
  - Methods: toString

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:35:18 +00:00

43 lines
598 B
CMake

register_repository(
NAME
libgit2
REPOSITORY
libgit2/libgit2
TAG
v1.9.0
)
set(LIBGIT2_CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTS=OFF
-DBUILD_CLI=OFF
-DUSE_SSH=OFF
-DUSE_HTTPS=OFF
-DUSE_BUNDLED_ZLIB=OFF
-DUSE_ICONV=OFF
-DREGEX_BACKEND=builtin
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_INSTALL_LIBDIR=lib
)
if(WIN32)
list(APPEND LIBGIT2_CMAKE_ARGS
-DWIN32_LEAKCHECK=OFF
)
endif()
register_cmake_command(
TARGET
libgit2
TARGETS
git2
ARGS
${LIBGIT2_CMAKE_ARGS}
LIB_PATH
lib
LIBRARIES
git2
INCLUDES
include
)