[2/4] examples: simplify getting list of all examples
Checks
Commit Message
Using find rather than shelling out to a one-liner script is easier to
read and understand, as well as allowing shorter lines in the code.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
examples/meson.build | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -8,8 +8,9 @@ endif
execinfo = cc.find_library('execinfo', required: false)
-all_examples = run_command('sh', '-c',
- 'cd $MESON_SOURCE_ROOT/$MESON_SUBDIR && for d in * ; do if [ -d $d ] ; then echo $d ; fi ; done'
+all_examples = run_command('find', meson.current_source_dir(),
+ '-maxdepth', '1', '-mindepth', '1',
+ '-type', 'd', '-printf', '%f '
).stdout().split()
# install all example code on install - irrespective of whether the example in
# question is to be built as part of this build or not.