Add nlohmann dependency
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I8b0a1c01d05b053fc0669f626a975f406d88549a
diff --git a/src/rde/meson.build b/src/rde/meson.build
index 1f13f18..5cc45cf 100644
--- a/src/rde/meson.build
+++ b/src/rde/meson.build
@@ -1,6 +1,21 @@
+
+cpp = meson.get_compiler('cpp')
+if cpp.has_header('nlohmann/json.hpp')
+ nlohmann_json_dep = declare_dependency()
+else
+ subproject('nlohmann', required: false)
+ nlohmann_json_dep = declare_dependency(
+ include_directories: [
+ 'subprojects/nlohmann/single_include',
+ 'subprojects/nlohmann/single_include/nlohmann',
+ ]
+ )
+endif
+
rde_pre = declare_dependency(
include_directories: [rde_inc],
dependencies: [
+ nlohmann_json_dep,
dependency('libbej'),
dependency('phosphor-dbus-interfaces'),
dependency('sdbusplus'),
diff --git a/subprojects/nlohmann.wrap b/subprojects/nlohmann.wrap
new file mode 100644
index 0000000..a77b7c9
--- /dev/null
+++ b/subprojects/nlohmann.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+revision = b3e5cb7f20dcc5c806e418df34324eca60d17d4e
+url = https://github.com/nlohmann/json.git