build: add wrapfile for nlohmann-json
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1d2c67b7a9db8e0e307d0b5d9efba1ae17c01de3
diff --git a/meson.build b/meson.build
index 127fa2c..6c55635 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,8 @@
language: 'cpp',
)
+cpp = meson.get_compiler('cpp')
+
build_tests = get_option('tests')
gpiodcxx = dependency(
'libgpiodcxx',
@@ -40,6 +42,18 @@
],
)
+if cpp.has_header('nlohmann/json.hpp')
+ nlohmann_json = declare_dependency()
+else
+ subproject('nlohmann-json')
+ nlohmann_json = declare_dependency(
+ include_directories: include_directories(
+ 'subprojects/nlohmann-json/single_include',
+ 'subprojects/nlohmann-json/single_include/nlohmann',
+ )
+ )
+endif
+
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable(
pkgconfig: 'systemdsystemunitdir',