Util functions to validate JSON and find data files
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Ifc1537f7c8eabab08690d5a74023377572564895
diff --git a/meson.build b/meson.build
index 514e94c..b7cb17e 100644
--- a/meson.build
+++ b/meson.build
@@ -77,6 +77,31 @@
pthread = declare_dependency(link_args : '-pthread')
lrt = declare_dependency(link_args : '-lrt')
+# JSON parser
+if cmplr.has_header('nlohmann/json.hpp')
+ nlohmann_json_dep = declare_dependency()
+else
+ subproject('nlohmann', required: false)
+ nlohmann_json_dep = declare_dependency(
+ include_directories: [
+ 'subprojects/nlohmann/single_include',
+ 'subprojects/nlohmann/single_include/nlohmann',
+ ]
+ )
+ nlohmann_json_dep = nlohmann_json_dep.as_system('system')
+endif
+
+# JSON validator
+if cmplr.has_header('valijson/validator.hpp')
+ valijson_dep = declare_dependency()
+else
+ subproject('valijson', required: false)
+ valijson_dep = declare_dependency(
+ include_directories: 'subprojects/valijson/include'
+ )
+ valijson_dep = valijson_dep.as_system('system')
+endif
+
#-------------------------------------------------------------------------------
# Build the local static libraries
#-------------------------------------------------------------------------------