examples: improve error report for missing meson deps
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 29 Mar 2018 13:54:35 +0000 (14:54 +0100)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 17 Apr 2018 14:09:43 +0000 (16:09 +0200)
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>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
examples/meson.build

index 16c3ab0..3d15684 100644 (file)
@@ -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'