[dpdk-dev,5/6] examples: improve error report for missing meson deps

Message ID 20180329135436.92878-6-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Bruce Richardson March 29, 2018, 1:54 p.m. UTC
  When a required library is missing on a platform, rather than having
meson report an error about the missing variable, catch the problem
earlier and provide a more readable message.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/examples/meson.build b/examples/meson.build
index 16c3ab005..3d1568497 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -32,8 +32,11 @@  foreach example: examples
 	if build
 		dep_objs = ext_deps
 		foreach d:deps
-			dep_objs += [get_variable(
-				get_option('default_library') + '_rte_' + d)]
+			var_name = get_option('default_library') + '_rte_' + d
+			if not is_variable(var_name)
+				error('Missing dependency "@0@" for example "@1@"'.format(d, name))
+			endif
+			dep_objs += [get_variable(var_name)]
 		endforeach
 		if allow_experimental_apis
 			cflags += '-DALLOW_EXPERIMENTAL_API'