[gvfs/wip/oholy/meson-version: 15/15] build: Use break in foreach loop
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/oholy/meson-version: 15/15] build: Use break in foreach loop
- Date: Thu, 16 May 2019 09:37:41 +0000 (UTC)
commit f80cef5a7dd1fec7714c0c20c7940a8ca1e3a798
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Thu Apr 4 15:28:13 2019 +0200
build: Use break in foreach loop
Since meson 0.49.0, `break` keyword can be used inside loops.
This feature has been used to stop when checking functions in
headers that makes avoiding loop iterations.
[0] http://mesonbuild.com/Release-notes-for-0-49-0.html#foreach-break-and-continue
meson.build | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 541ab708..c11b0c22 100644
--- a/meson.build
+++ b/meson.build
@@ -170,7 +170,10 @@ foreach name: ['mkdev', 'sysmacros']
have_major = true
header = 'sys/@0@.h'.format(name)
foreach func: ['major', 'minor', 'makedev']
- have_major = have_major and cc.has_header_symbol(header, func)
+ if not cc.has_header_symbol(header, func)
+ have_major = false
+ break
+ endif
endforeach
config_h.set10('MAJOR_IN_' + name.to_upper(), have_major)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]