summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2021-09-13 23:35:40 +0200
committerIñigo Martínez <inigomartinez@gmail.com>2021-10-25 15:56:32 +0200
commitee00d22bd526f938b6499739014c8d81b8a9f6f3 (patch)
tree6fe155e891c27c642f46e9486a8d208ba1311015 /meson.build
parent131cd41d343e76c13b825262fcb47d9e94c70b32 (diff)
downloadgvfs-ee00d22bd526f938b6499739014c8d81b8a9f6f3.tar.gz
build: Use dictionary for easier unpack
Dictionaries can be used to ease `foreach` statements due to their natural unpacking system[0]. This system has been used to ease some loops. [0] https://mesonbuild.com/Syntax.html#foreach-with-a-dictionary
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build34
1 files changed, 17 insertions, 17 deletions
diff --git a/meson.build b/meson.build
index 52188993..c82b3aba 100644
--- a/meson.build
+++ b/meson.build
@@ -44,16 +44,16 @@ cc = meson.get_compiler('c')
config_h = configuration_data()
# defines
-set_defines = [
+set_defines = {
# package
- ['PACKAGE_STRING', '@0@ @1@'.format(gvfs_name, gvfs_version)],
- ['VERSION', gvfs_version],
+ 'PACKAGE_STRING': '@0@ @1@'.format(gvfs_name, gvfs_version),
+ 'VERSION': gvfs_version,
# i18n
- ['GETTEXT_PACKAGE', gvfs_name],
-]
+ 'GETTEXT_PACKAGE': gvfs_name,
+}
-foreach define: set_defines
- config_h.set_quoted(define[0], define[1])
+foreach define, value: set_defines
+ config_h.set_quoted(define, value)
endforeach
# Globally define_GNU_SOURCE and therefore enable the GNU extensions
@@ -179,17 +179,17 @@ foreach name: ['mkdev', 'sysmacros']
endforeach
# types
-check_types = [
+check_types = {
# type, fallback type
- ['gid_t', 'int'],
- ['pid_t', 'int'],
- ['size_t', 'unsigned int'],
- ['uid_t', 'int'],
-]
-
-foreach type: check_types
- if not cc.has_type(type[0], prefix: '#include<sys/types.h>')
- config_h.set(type[0], type[1])
+ 'gid_t': 'int',
+ 'pid_t': 'int',
+ 'size_t': 'unsigned int',
+ 'uid_t': 'int',
+}
+
+foreach type, value: check_types
+ if not cc.has_type(type, prefix: '#include<sys/types.h>')
+ config_h.set(type, value)
endif
endforeach