summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-05-26 19:42:08 +0300
committerEd Tanous <ed@tanous.net>2023-06-05 21:33:36 +0300
commitc9374ff613b6836010877f8083e75657abc78343 (patch)
treeb7604e10e97267fdc8c4caedf3ca4ef906351d5d /meson.build
parent4220be3b25a3d70eb632661cae09d875e039421b (diff)
downloadbmcweb-c9374ff613b6836010877f8083e75657abc78343.tar.xz
Subproject nlohmann and tinyxml2
Like the other dependencies, we should support auto download of these packages through subproject. Tested: meson build ninja -C build Succeeded when tinyxml2 and nlohmann were not installed on the host system. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iad3769c6d8377f6eff78c34b98ca80da5e4fa187
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 12 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 46d6e03557..6cdde78193 100644
--- a/meson.build
+++ b/meson.build
@@ -266,26 +266,31 @@ if not sdbusplus.found()
endif
bmcweb_dependencies += sdbusplus
-tinyxml = dependency('tinyxml2',
- default_options: ['tests=false'],
+tinyxml = dependency(
+ 'tinyxml2',
include_type: 'system',
+ version: '>=9.0.0',
)
+if not tinyxml.found()
+ tinyxml_proj = subproject('tinyxml2', required: true)
+ tinyxml = tinyxml_proj.get_variable('tinyxml_dep')
+ tinyxml = tinyxml.as_system('system')
+endif
bmcweb_dependencies += tinyxml
systemd = dependency('systemd')
zlib = dependency('zlib')
bmcweb_dependencies += [systemd, zlib]
-if cxx.has_header('nlohmann/json.hpp')
- nlohmann_json = declare_dependency()
-else
+nlohmann_json = dependency('nlohmann', version: '>=3.9.2', required: false, include_type: 'system')
+if not nlohmann_json.found()
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
-boost = dependency('boost',version : '>=1.81.0', required : false, include_type: 'system')
+boost = dependency('boost',version : '>=1.82.0', required : false, include_type: 'system')
if not boost.found()
boost = subproject('boost', required: true).get_variable('boost_dep')
boost = boost.as_system('system')
@@ -293,7 +298,7 @@ endif
bmcweb_dependencies += boost
if get_option('tests').enabled()
- gtest = dependency('gtest', main: true,disabler: true, required : false)
+ gtest = dependency('gtest', main: true, disabler: true, required : false)
gmock = dependency('gmock', required : false)
if not gtest.found() and get_option('tests').enabled()
gtest_proj = subproject('gtest', required: true)