taskolib / libgit4cpp

C++ wrapper for libgit2 with limited functionality
https://taskolib.github.io/libgit4cpp/
GNU Lesser General Public License v2.1
1 stars 0 forks source link

libgit4cpp

libgit4cpp is a lightweight C++ wrapper around the libgit2 C library. It was mainly developed for use in taskolib and covers only a tiny subset of the functionality of the original library.

The library API is documented with Doxygen on the web page https://taskolib.github.io/libgit4cpp/ .

License

libgit4cpp is free software distributed under the terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1).

Building

The library is built with Meson/Ninja. Building is done in two stages: You start by setting up the build system with a call to Meson. All configurable options are set in this step. Then, you start the actual build with the ninja command.

To set up a build directory builddir with the default configuration and build the library in it:

  meson builddir
  ninja -C builddir

By convention, directory names starting with build or subdirectories of a build*/ folder are used.

Debug and Release Builds

Meson differentiates between debug and release builds at configuration time (when setting up the build directory). These are the most often used variants:

  meson --buildtype=debug builddir
  meson --buildtype=debugoptimized builddir
  meson --buildtype=release builddir

Building the Documentation

This library carries documentation embedded in the source code. Run the following tool to generate HTML documentation:

  ./tools/make-doc.py

This runs the open-source tool Doxygen and generates a web page in the directory docs/html.

Inspect Parameters

To see all the possible and the active settings, change into the build directory and call meson configure. You can see some of the built-in possibilities there, like unity builds and sanitizer to use.

Examples

like: make

  meson --buildtype debug builddir

Not optimized build in builddir/ (optimized for debugging in gdb for ex.)

like: make install

  meson builddir

Fully optimized build in builddir/, installs in /usr/lib and /usr/lib/include.

This can be used together with debuild to create packages, after adapting the debian/rules (not recommended, just use the existing rules). The staging directory will be transfered via DESTDIR.

like: make localinstall

(install in $HOME/???/lib)

  meson --prefix ???/somewhere builddir

Installs into the user's home directory.

To use it one has to set LD_LIBRARY_PATH, PKG_CONFIG_PATH, and CPATH (probably).

After the setup phase

... one can call any of these:

  ninja -C builddir
  ninja -C builddir test
  ninja -C builddir install
  ninja -C builddir clean
  rm -Rf builddir