meson: add support for nlohmann-json vendoring
Abuse the meson subproject command to download nlohmann and build
against that when nlohmann is not found in the usual places. This
enables building and running of the unit tests without needing to
install nlohmann.
This is abuse because the subproject command will always fail - meson
only supports other meson projects as subprojects but it will download
the project, and since we don't actually build nlohmann but just use
headers this isn't a problem.
Change-Id: I3cff76f8face3ebe66611d169775b472c18b1e4c
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/src/meson.build b/src/meson.build
index ea446fc..8218a15 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -8,6 +8,7 @@
cpp_args: cpp_args + ['-DBOOST_ASIO_DISABLE_THREADS'],
dependencies: [
boost,
+ nlohmann_json,
sdbusplus,
],
implicit_include_directories: false,
@@ -23,6 +24,7 @@
dependencies: [
boost,
i2c,
+ nlohmann_json,
sdbusplus,
threads,
],