From 31fe2f5825d2268138060a91b7d0305293149078 Mon Sep 17 00:00:00 2001 From: Jay Sistar Date: Mon, 8 May 2017 13:35:00 +0000 Subject: [PATCH 1/3] Adding support for Meson. --- README.md | 24 ++++++++++++++++++++++++ meson.build | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 meson.build diff --git a/README.md b/README.md index fe92f9f14..1bf3d67bc 100644 --- a/README.md +++ b/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. diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..2cfc96285 --- /dev/null +++ b/meson.build @@ -0,0 +1,7 @@ +project('nlohmann_json', 'cpp') + +nlohmann_json_inc = include_directories('src') + +nlohmann_json_dep = declare_dependency( + include_directories : nlohmann_json_inc +) From 0719287e4474b9d0ddc6ba5be5533d3317a6a85e Mon Sep 17 00:00:00 2001 From: Jay Sistar Date: Tue, 9 May 2017 02:01:55 +0000 Subject: [PATCH 2/3] Reducing chatter about Meson. --- README.md | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/README.md b/README.md index 1bf3d67bc..0637136ee 100644 --- a/README.md +++ b/README.md @@ -66,30 +66,9 @@ 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 -``` - +If you are using the Meson Build System, then you can wrap this repo as a subproject. 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. From 87744fd594cb838c8d3eb26226a0f9c76e2ca85d Mon Sep 17 00:00:00 2001 From: Jay Sistar Date: Tue, 9 May 2017 02:04:02 +0000 Subject: [PATCH 3/3] Missed one. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0637136ee..6ef08a564 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ 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 you can wrap this repo as a subproject. -You can then create a reference to it in your `meson.build` file by adding the line: :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.