Avoid hardcoding nlohmann_json include directory
As recommended by the warning message that appears from Meson, picking
up the include directory from the nlohmann_json package itself, as it
exports the nlohmann_json_dep Meson variable, instead of having to
hardcode the directory paths here.
Tested: Works for me, warning message goes away
Change-Id: Ifaf10dc8ac45566c509c3ba80ba7b338bc8fe44c
Signed-off-by: Josh Lehan <krellan@google.com>
diff --git a/meson.build b/meson.build
index 66258a8..bc492cd 100644
--- a/meson.build
+++ b/meson.build
@@ -307,13 +307,8 @@
if cxx.has_header('nlohmann/json.hpp')
nlohmann_json = declare_dependency()
else
- subproject('nlohmann', required: false)
- nlohmann_json = declare_dependency(
- include_directories: [
- 'subprojects/nlohmann/single_include',
- 'subprojects/nlohmann/single_include/nlohmann',
- ]
- )
+ nlohmann_json_proj = subproject('nlohmann', required: true)
+ nlohmann_json = nlohmann_json_proj.get_variable('nlohmann_json_dep')
nlohmann_json = nlohmann_json.as_system('system')
endif
bmcweb_dependencies += nlohmann_json