meson: adjust nlohmann-json dependency
Simplify meson dependency logic and align wrap file name choice with
other repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5388303c3a5227cfd3981878354cc62b90ebcb99
diff --git a/meson.build b/meson.build
index 8dfa828..927f532 100644
--- a/meson.build
+++ b/meson.build
@@ -11,7 +11,7 @@
meson_version: '>=0.58.0',
)
-# Enable io_uring for all daemons with below flags.
+# Enable io_uring for all daemons with below flags.
# '-DBOOST_ASIO_HAS_IO_URING',
# '-DBOOST_ASIO_DISABLE_EPOLL',
# '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT',
@@ -55,12 +55,7 @@
endif
phosphor_logging_dep = dependency('phosphor-logging')
-
-if cpp.has_header('nlohmann/json.hpp')
- nlohmann_json = declare_dependency()
-else
- nlohmann_json = dependency('nlohmann_json')
-endif
+nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
systemd = dependency('systemd')
systemd_system_unit_dir = systemd.get_variable(
@@ -85,7 +80,7 @@
default_deps = [
boost,
- nlohmann_json,
+ nlohmann_json_dep,
phosphor_logging_dep,
sdbusplus,
uring,
diff --git a/subprojects/nlohmann-json.wrap b/subprojects/nlohmann_json.wrap
similarity index 99%
rename from subprojects/nlohmann-json.wrap
rename to subprojects/nlohmann_json.wrap
index dbe7d46..3745380 100644
--- a/subprojects/nlohmann-json.wrap
+++ b/subprojects/nlohmann_json.wrap
@@ -1,6 +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