subprojects: nlohmann,cli11: add wraps and configure
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iccc5be03b2428969ff8a51f24820e81faafcdcbf
diff --git a/meson.build b/meson.build
index 0a4238b..56cb156 100644
--- a/meson.build
+++ b/meson.build
@@ -72,15 +72,24 @@
install: true,
)
-if not build_tests.disabled()
- subdir('test')
-endif
-
compiler = meson.get_compiler('cpp')
python = find_program('python3', required:true)
-compiler.has_header('CLI/CLI.hpp')
-compiler.has_header('nlohmann/json.hpp')
+if compiler.has_header('CLI/CLI.hpp')
+ CLI11_dep = declare_dependency()
+else
+ CLI11_dep = dependency('CLI11')
+endif
+
+if compiler.has_header('nlohmann/json.hpp')
+ nlohmann_json_dep = declare_dependency()
+else
+ nlohmann_json_dep = dependency('nlohmann-json')
+endif
+
+if not build_tests.disabled()
+ subdir('test')
+endif
configure_file(output: 'config.h',
configuration :{
@@ -133,6 +142,8 @@
sdbusplus,
phosphor_logging,
libgpiodcxx,
+ nlohmann_json_dep,
+ CLI11_dep,
],
link_with : libvpdecc,
include_directories : vpd_tool_INCLUDE,
@@ -150,9 +161,11 @@
'vpd-tool',
vpd_tool_SOURCES,
dependencies: [
- sdbusplus,
+ CLI11_dep,
+ libgpiodcxx,
+ nlohmann_json_dep,
phosphor_logging,
- libgpiodcxx
+ sdbusplus,
],
link_with : libvpdecc,
install: true,
@@ -252,6 +265,7 @@
dependencies: [
sdbusplus,
phosphor_logging,
+ nlohmann_json_dep,
],
include_directories : 'vpd-parser/',
install: true,