view @ 37:ab071d485d38 default tip @

misc: update copyright years
author David Demelier <>
date Thu, 04 Jan 2024 10:42:26 +0100
parents 0a3e0a53da3e
line wrap: on
line source

libbuf INSTALL

Installation instructions.


- C99 compiler.


Copy buf.h and buf.c to your project.


The module is small enough to be incorporated verbatim into your project, but it
still possible to install it system wide.

### Using CMake

Using [CMake][cmake] you get proper CMake package configuration files, shared
libraries and `pkg-config` files.

	$ cmake -S . -B build -DBUILD_SHARED_LIBS=On
	$ cmake --build build
	# cmake --build build --target install

Turn `BUILD_SHARED_LIBS` to *Off* if you don't want shared libraries.

Then, you can import `buf` and use on of the imported targets:

- `buf::libbuf`: shared if available, static otherwise,
- `buf::libbuf-shared`: shared version,
- `buf::libbuf-static`: static version.

The test suite is available using:

	$ ctest --test-dir build


	cmake_minimum_required(VERSION 3.20)
	find_package(buf REQUIRED)
	add_executable(example example.c)
	target_link_libraries(example buf::libbuf)