meson: adjust nlohmann-json dependency
Simplify the dependency directive and align with the usage in other
repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6b140e3a26314de110902bb4dceb1e8c57d80c3c
diff --git a/meson.build b/meson.build
index 0ca55ad..bec557a 100644
--- a/meson.build
+++ b/meson.build
@@ -21,18 +21,6 @@
)
endif
-if cpp.has_header('nlohmann/json.hpp')
- nlohmann_json = declare_dependency()
-else
- subproject('nlohmann-json')
- nlohmann_json = declare_dependency(
- include_directories: [
- 'subprojects/nlohmann-json/single_include',
- 'subprojects/nlohmann-json/single_include/nlohmann',
- ]
- )
-endif
-
executable(
'virtual-sensor',
[
@@ -41,11 +29,11 @@
'dbusUtils.cpp',
],
dependencies: [
+ dependency('nlohmann_json', include_type: 'system'),
dependency('phosphor-dbus-interfaces'),
dependency('phosphor-logging'),
dependency('sdbusplus'),
exprtk,
- nlohmann_json,
],
install: true,
install_dir: get_option('bindir')
diff --git a/subprojects/nlohmann-json.wrap b/subprojects/nlohmann_json.wrap
similarity index 61%
rename from subprojects/nlohmann-json.wrap
rename to subprojects/nlohmann_json.wrap
index 9096612..3745380 100644
--- a/subprojects/nlohmann-json.wrap
+++ b/subprojects/nlohmann_json.wrap
@@ -1,3 +1,6 @@
[wrap-git]
-url = https://github.com/nlohmann/json.git
revision = HEAD
+url = https://github.com/nlohmann/json.git
+
+[provide]
+nlohmann_json = nlohmann_json_dep