meson: adjust nlohmann-json dependency

Simplify the meson dependency for nlohmann-json, use the consistent
dependency name, and align the wrap file name with other repositories.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3a682a3e07e38d0a1bfe35858e24f1bb74b4ec34
diff --git a/common/test/meson.build b/common/test/meson.build
index 3ad51a6..bedb93e 100644
--- a/common/test/meson.build
+++ b/common/test/meson.build
@@ -15,7 +15,7 @@
                          common_test_src,
                          gtest,
                          libpldm_dep,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          phosphor_dbus_interfaces,
                          phosphor_logging_dep,
                          libpldmutils,
diff --git a/fw-update/test/meson.build b/fw-update/test/meson.build
index a3fec9c..ce47e57 100644
--- a/fw-update/test/meson.build
+++ b/fw-update/test/meson.build
@@ -25,7 +25,7 @@
                          gtest,
                          libpldm_dep,
                          libpldmutils,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          phosphor_dbus_interfaces,
                          phosphor_logging_dep,
                          sdbusplus,
diff --git a/host-bmc/test/meson.build b/host-bmc/test/meson.build
index 92294eb..9c4a0dd 100644
--- a/host-bmc/test/meson.build
+++ b/host-bmc/test/meson.build
@@ -25,7 +25,7 @@
                          host_bmc_test_src,
                          libpldm_dep,
                          libpldmutils,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          phosphor_dbus_interfaces,
                          phosphor_logging_dep,
                          sdbusplus,
diff --git a/libpldmresponder/meson.build b/libpldmresponder/meson.build
index f949db9..687fa82 100644
--- a/libpldmresponder/meson.build
+++ b/libpldmresponder/meson.build
@@ -1,7 +1,7 @@
 libpldmresponder_deps = [
   phosphor_dbus_interfaces,
   phosphor_logging_dep,
-  nlohmann_json,
+  nlohmann_json_dep,
   sdbusplus,
   sdeventplus,
   libpldm_dep,
diff --git a/libpldmresponder/test/meson.build b/libpldmresponder/test/meson.build
index 8c9a845..17eceac 100644
--- a/libpldmresponder/test/meson.build
+++ b/libpldmresponder/test/meson.build
@@ -33,7 +33,7 @@
                          libpldmutils,
                          gtest,
                          gmock,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          phosphor_dbus_interfaces,
                          phosphor_logging_dep,
                          sdeventplus,
diff --git a/meson.build b/meson.build
index 2e4d8fd..3430735 100644
--- a/meson.build
+++ b/meson.build
@@ -84,11 +84,7 @@
 stdplus = dependency('stdplus')
 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')
 
 if cpp.has_header('CLI/CLI.hpp')
   CLI11_dep = declare_dependency()
@@ -146,7 +142,7 @@
       libpldm_dep,
       phosphor_dbus_interfaces,
       phosphor_logging_dep,
-      nlohmann_json,
+      nlohmann_json_dep,
       sdbusplus,
   ],
   install: true,
@@ -160,7 +156,7 @@
 deps = [
   libpldm_dep,
   libpldmutils,
-  nlohmann_json,
+  nlohmann_json_dep,
   phosphor_dbus_interfaces,
   phosphor_logging_dep,
   sdbusplus,
diff --git a/pldmtool/meson.build b/pldmtool/meson.build
index 17fe374..1567323 100644
--- a/pldmtool/meson.build
+++ b/pldmtool/meson.build
@@ -25,7 +25,7 @@
     CLI11_dep,
     libpldm_dep,
     libpldmutils,
-    nlohmann_json,
+    nlohmann_json_dep,
     phosphor_dbus_interfaces,
     sdbusplus,
   ],
diff --git a/requester/test/meson.build b/requester/test/meson.build
index a4f3cd8..328bacf 100644
--- a/requester/test/meson.build
+++ b/requester/test/meson.build
@@ -13,7 +13,7 @@
                          gtest,
                          gmock,
                          libpldm_dep,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          phosphor_dbus_interfaces,
                          phosphor_logging_dep,
                          sdbusplus,
diff --git a/softoff/meson.build b/softoff/meson.build
index 2d672af..fd57108 100644
--- a/softoff/meson.build
+++ b/softoff/meson.build
@@ -1,7 +1,7 @@
 deps = [
     libpldm_dep,
     libpldmutils,
-    nlohmann_json,
+    nlohmann_json_dep,
     sdeventplus,
     sdbusplus,
     phosphor_dbus_interfaces,
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
diff --git a/test/meson.build b/test/meson.build
index 468f087..b4739d9 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -13,7 +13,7 @@
                      build_rpath: get_option('oe-sdk').allowed() ? rpath : '',
                      dependencies: [
                          libpldm_dep,
-                         nlohmann_json,
+                         nlohmann_json_dep,
                          gtest,
                          test_src]),
        workdir: meson.current_source_dir())