[gdk-pixbuf/ebassi/for-master] build: Use `type:array` for builtin_loaders option
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf/ebassi/for-master] build: Use `type:array` for builtin_loaders option
- Date: Thu, 8 Apr 2021 16:46:17 +0000 (UTC)
commit dac7bbac2ed73449a1cfc02745dbcd73f90f0538
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Apr 8 17:28:02 2021 +0100
build: Use `type:array` for builtin_loaders option
This gives us an actual array, and lets Meson deal with the argument
parsing. It also gives us a default value that we can specify in the
meson_options.txt.
meson.build | 12 +++---------
meson_options.txt | 7 ++++---
2 files changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/meson.build b/meson.build
index b84d804c7..0241fcde0 100644
--- a/meson.build
+++ b/meson.build
@@ -237,21 +237,15 @@ else
endif
gdk_pixbuf_conf.set('USE_GMODULE', build_modules)
-# We want these loaders to be built into gdk-pixbuf unless
-# the builtin_loaders option specifies otherwise
-default_builtin_loaders = [ 'png', 'jpeg' ]
-
# Check which loaders should be built into gdk-pixbuf
-builtin_loaders = get_option('builtin_loaders').split(',')
+builtin_loaders = get_option('builtin_loaders')
# If 'all' is specified for builtin_loaders, build all
# buildable loaders into gdk-pixbuf
builtin_all_loaders = false
-if builtin_loaders == [ 'all' ]
+if builtin_loaders.contains('all')
builtin_all_loaders = true
-elif builtin_loaders == [ 'default' ]
- builtin_loaders = default_builtin_loaders
-elif builtin_loaders == [ 'none' ]
+elif builtin_loaders.contains('none')
builtin_loaders = []
endif
diff --git a/meson_options.txt b/meson_options.txt
index 0705e8cde..0ee6718bf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,9 +11,10 @@ option('jpeg',
type: 'boolean',
value: true)
option('builtin_loaders',
- description: 'Comma-separated list of loaders to build into gdk-pixbuf, or "default", or "none", or
"all" to build all buildable loaders into gdk-pixbuf',
- type: 'string',
- value: 'default')
+ description: 'Comma-separated list of loaders to build into gdk-pixbuf',
+ type: 'array',
+ choices: ['all', 'none', 'windows', 'png', 'bmp', 'gif', 'ico', 'ani', 'jpeg', 'pnm', 'tiff', 'xpm',
'xbm', 'tga', 'icns', 'qtif'],
+ value: ['png', 'jpeg'])
option('gtk_doc',
description: 'Whether to generate the API reference',
type: 'boolean',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]