mirror of
https://github.com/nlohmann/json.git
synced 2024-11-27 16:49:02 +08:00
Adding support for Meson.
This commit is contained in:
parent
962da00171
commit
31fe2f5825
24
README.md
24
README.md
@ -66,6 +66,30 @@ to the files you want to use JSON objects. That's it. Do not forget to set the n
|
||||
|
||||
:beer: If you are using OS X and [Homebrew](http://brew.sh), just type `brew tap nlohmann/json` and `brew install nlohmann_json` and you're set. If you want the bleeding edge rather than the latest release, use `brew install nlohmann_json --HEAD`.
|
||||
|
||||
If you are using the Meson Build System, then add a file called `nlohmann_json.wrap` to a file to your `subprojects` directory with the following 4 lines:
|
||||
|
||||
```
|
||||
[wrap-git]
|
||||
directory=nlohmann_json
|
||||
url=https://github.com/nlohmann/json.git
|
||||
revision=head
|
||||
```
|
||||
|
||||
You can then create a reference to it in your `meson.build` file by adding the line:
|
||||
|
||||
```
|
||||
nlohmann_json_sp = subproject('nlohmann_json')
|
||||
```
|
||||
|
||||
Here's an example of an executable called `awesomeness` that uses this library through the reference created above.
|
||||
|
||||
```
|
||||
executable('awesomeness',
|
||||
'awesomeness.cpp',
|
||||
dependencies: nlohmann_json_sp.get_variable('nlohmann_json_dep')
|
||||
)
|
||||
```
|
||||
|
||||
:warning: [Version 3.0.0](https://github.com/nlohmann/json/wiki/Road-toward-3.0.0) is currently under development. Branch `develop` is used for the ongoing work and is probably **unstable**. Please use the `master` branch for the last stable version 2.1.1.
|
||||
|
||||
|
||||
|
7
meson.build
Normal file
7
meson.build
Normal file
@ -0,0 +1,7 @@
|
||||
project('nlohmann_json', 'cpp')
|
||||
|
||||
nlohmann_json_inc = include_directories('src')
|
||||
|
||||
nlohmann_json_dep = declare_dependency(
|
||||
include_directories : nlohmann_json_inc
|
||||
)
|
Loading…
Reference in New Issue
Block a user