view @ 29:31bbe01fe501 default tip

make: ditch GNU make
author David Demelier <>
date Tue, 07 Feb 2023 17:48:14 +0100
parents f06312a7432b
line wrap: on
line source

libunicode -- installation instructions


- C99 (at least `EILSEQ` has to be available as errno constant).
- C11 (for running tests).
- `uint32_t` and `uint8_t` types.


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


The file unicode.c is generated from gen/ subdirectory. Edit the appropriate
files and run `regenerate` target from CMake build directory.


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 `unicode` and use on of the imported targets:

- `unicode::libunicode`: shared if available, static otherwise,
- `unicode::libunicode-shared`: shared version,
- `unicode::libunicode-static`: static version.

The test suite is available using:

	$ ctest --test-dir build


	cmake_minimum_required(VERSION 3.20)
	find_package(unicode REQUIRED)
	add_executable(example example.c)
	target_link_libraries(example unicode::libunicode)