doc: explain a macro to link pre-built lib

This commit is contained in:
ToruNiina
2024-06-28 23:52:58 +09:00
parent 5d23f4b8a8
commit d00c0c1b15
4 changed files with 34 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
[日本語版](https://github.com/ToruNiina/toml11/blob/main/README_ja.md)
toml11 is a feature-rich TOML language library for C++.
toml11 is a feature-rich TOML language library for C++11/14/17/20.
- It complies with [the latest TOML language specification](https://toml.io/en/v1.0.0).
- It passes all the standard TOML language [test cases](https://github.com/toml-lang/toml-test).
@@ -124,6 +124,14 @@ $ cmake -B ./build/ -DTOML11_PRECOMPILE=ON -DCMAKE_CXX_STANDARD=11/14/17/20
$ cmake --build ./build/
```
When linking the library, use `target_link_libraries` in CMake
```cmake
target_link_libraries(your_target PUBLIC toml11::toml11)
```
or pass `-DTOML11_COMPILE_SOURCES` to the compiler.
### Building Example
To compile the examples in the `examples/` directory, set `-DTOML11_BUILD_EXAMPLES=ON`.