compat.libgit2
#includeCross-platform, linkable library implementation of Git
#include <git2.h>
mcpp add compat.libgit2@1.9.7
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
#include <git2.h>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
namespace fs = std::filesystem;
namespace {
bool Expect(bool ok, const char* msg) {
if (!ok) {
std::cerr << "FAIL: " << msg << "\n";
}
return ok;
}
} // namespace
int main() {
// …
tests/examples/libgit2/tests/libgit2.cpp · 项目 tests/examples/libgit2
构建
- targets
git2 (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/include
源文件 (14)
*/src/libgit2/*.c*/src/libgit2/streams/*.c*/src/libgit2/transports/*.c*/src/util/*.c*/src/util/allocators/*.c*/src/util/hash.c*/src/util/hash/collisiondetect.c*/src/util/hash/sha1dc/*.c*/src/util/hash/builtin.c*/src/util/hash/rfc6234/*.c*/deps/llhttp/*.c*/deps/xdiff/*.c*/deps/pcre2/*.c!*/deps/pcre2/pcre2_fuzzsupport.c
生成的文件
mcpp_generated/gen_headers/experimental.hmcpp_generated/pcre2/config.hmcpp_generated/gen_headers/git2_features.h