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,
diff --git a/subprojects/CLI11.wrap b/subprojects/CLI11.wrap
new file mode 100644
index 0000000..2e5a95b
--- /dev/null
+++ b/subprojects/CLI11.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://github.com/CLIUtils/CLI11.git
+revision = HEAD
+
+[provide]
+CLI11 = CLI11_dep
diff --git a/subprojects/nlohmann-json.wrap b/subprojects/nlohmann-json.wrap
new file mode 100644
index 0000000..a2884b1
--- /dev/null
+++ b/subprojects/nlohmann-json.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://github.com/nlohmann/json
+revision = HEAD
+
+[provide]
+nlohmann-json = nlohmann_json_dep
diff --git a/test/meson.build b/test/meson.build
index 6ad140d..f55315b 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -14,7 +14,7 @@
gmock = dependency('gmock', disabler: true, required: build_tests)
gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
libgpiodcxx = dependency('libgpiodcxx', default_options: ['bindings=cxx'])
-dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces, libgpiodcxx]
+dependecy_list = [gtest, gmock, sdbusplus, phosphor_logging, phosphor_dbus_interfaces, libgpiodcxx, nlohmann_json_dep]
configuration_inc = include_directories('..', '../vpd-manager', 'vpd-manager-test', '../vpd-parser')
diff --git a/vpd-manager/meson.build b/vpd-manager/meson.build
index 574629e..cb6f32b 100644
--- a/vpd-manager/meson.build
+++ b/vpd-manager/meson.build
@@ -3,28 +3,32 @@
configuration_inc = include_directories('.', '../', '../vpd-parser/')
-vpd_manager_SOURCES =['manager_main.cpp',
- 'manager.cpp',
- 'error.cpp',
- 'editor_impl.cpp',
- 'reader_impl.cpp',
- 'gpioMonitor.cpp',
- 'bios_handler.cpp',
- '../impl.cpp',
- '../vpd-parser/ipz_parser.cpp',
- '../ibm_vpd_utils.cpp',
- '../common_utility.cpp',
- '../vpd-parser//keyword_vpd_parser.cpp',
- '../vpd-parser/memory_vpd_parser.cpp',
- '../vpd-parser/isdimm_vpd_parser.cpp',
- '../vpd-parser/parser_factory.cpp'
- ]
+vpd_manager_SOURCES = [
+ 'manager_main.cpp',
+ 'manager.cpp',
+ 'error.cpp',
+ 'editor_impl.cpp',
+ 'reader_impl.cpp',
+ 'gpioMonitor.cpp',
+ 'bios_handler.cpp',
+ '../impl.cpp',
+ '../vpd-parser/ipz_parser.cpp',
+ '../ibm_vpd_utils.cpp',
+ '../common_utility.cpp',
+ '../vpd-parser//keyword_vpd_parser.cpp',
+ '../vpd-parser/memory_vpd_parser.cpp',
+ '../vpd-parser/isdimm_vpd_parser.cpp',
+ '../vpd-parser/parser_factory.cpp'
+]
-vpd_manager_dependencies =[phosphor_logging,
- systemd,
- libgpiodcxx,
- sdeventplus,
- ]
+vpd_manager_dependencies = [
+ CLI11_dep,
+ libgpiodcxx,
+ phosphor_logging,
+ sdeventplus,
+ systemd,
+ nlohmann_json_dep,
+]
vpd_manager_exe = executable(
'vpd-manager',