From 0fe8d7959bdc09f580b9fd2f17c6a170502a6d93 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sun, 22 Mar 2020 22:54:22 +0100 Subject: [PATCH] updated README.md to reflect the new dual-mode --- README.md | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 456ca60c..167f1a52 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,11 @@ and still support me today. # Introduction -`uvw` is a header-only, event based, tiny and easy to use -[`libuv`](https://github.com/libuv/libuv) wrapper in modern C++.
+`uvw` started as a header-only, event based, tiny and easy to use wrapper for +[`libuv`](https://github.com/libuv/libuv) written in modern C++.
+Now it's finally available also as a compilable library, either static or +shared. + The basic idea is to hide completely the *C-ish* interface of `libuv` behind a graceful C++ API. Currently, no `uv_*_t` data structure is actually exposed by the library.
@@ -107,9 +110,15 @@ tests. ## Library -`uvw` is a header-only library.
-This means that including the `uvw.hpp` header or one of the other `uvw/*.hpp` -headers is enough to use it.
+`uvw` is a dual-mode library. It can be used in its header-only form or as a +compiled library, either shared or static.
+The following sections describe what to do in both cases to get `uvw` up and +runningin your own project. + +### Header-only + +To use `uvw` as a header-only library, all is needed is to include the `uvw.hpp` +header or one of the other `uvw/*.hpp` files.
It's a matter of adding the following line at the top of a file: ```cpp @@ -121,6 +130,21 @@ the include paths.
Note that users are required to correctly setup the include directories and libraries search paths for `libuv`. +When used through `CMake`, the `uvw::uvw` target is exported for convenience. + +### Static/Shared + +To use `uvw` as a compiled library, set the `BUILD_UVW_LIBS` options in cmake +before including the project.
+This option triggers the generation of two targets named respectively +`uvw::uvw-static` and `uvw::uvw-shared`. The matching version of `libuv` is also +compiled and exported as `uv::uv-static` and `uv::uv-shared` for convenience. + +In case you don't use or don't want to use `CMake`, you can still compile all +`.cpp` files and include all `.h` files to get the job done. In this case, users +are required to correctly setup the include directories and libraries search +paths for `libuv`. + ## Versioning Starting with tag _v1.12.0_ of `libuv`, `uvw` follows the