Mercurial > libunicode
view INSTALL.md @ 30:303403de1314 default tip @
misc: update copyright years
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 04 Jan 2024 10:43:47 +0100 |
parents | 31bbe01fe501 |
children |
line wrap: on
line source
libunicode -- installation instructions ======================================= Requirements ------------ - C99 (at least `EILSEQ` has to be available as errno constant). - C11 (for running tests). - `uint32_t` and `uint8_t` types. Embed ----- Copy unicode.h and unicode.c to your project. Regeneration ------------ The file unicode.c is generated from gen/ subdirectory. Edit the appropriate files and run `regenerate` target from CMake build directory. Installation ------------ 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 Example: cmake_minimum_required(VERSION 3.20) project(example) find_package(unicode REQUIRED) add_executable(example example.c) target_link_libraries(example unicode::libunicode) [cmake]: http://cmake.org