From 0204895143d4aacf143be952f962dc47e415c187 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 3 Feb 2018 21:30:44 +0200 Subject: Expose integer options to build option files. --- docs/markdown/Build-options.md | 7 +++++++ docs/markdown/snippets/intopt.md | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 docs/markdown/snippets/intopt.md (limited to 'docs') diff --git a/docs/markdown/Build-options.md b/docs/markdown/Build-options.md index cd7f07d1b..85e827424 100644 --- a/docs/markdown/Build-options.md +++ b/docs/markdown/Build-options.md @@ -16,6 +16,7 @@ Here is a simple option file. option('someoption', type : 'string', value : 'optval', description : 'An option') option('other_one', type : 'boolean', value : false) option('combo_opt', type : 'combo', choices : ['one', 'two', 'three'], value : 'three') +option('integer_opt', type : 'integer', min : 0, max : 5, value : 3) option('free_array_opt', type : 'array', value : ['one', 'two']) option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two']) ``` @@ -39,6 +40,12 @@ A combo allows any one of the values in the `choices` parameter to be selected. If no default value is set then the first value will be the default. +## Integers + +An integer option contains a single integer with optional upper and +lower values that are specified with the `min` and `max` keyword +arguments. Available since Meson version 0.45.0. + ### Arrays Arrays represent an array of strings. By default the array can contain diff --git a/docs/markdown/snippets/intopt.md b/docs/markdown/snippets/intopt.md new file mode 100644 index 000000000..daf660b0d --- /dev/null +++ b/docs/markdown/snippets/intopt.md @@ -0,0 +1,6 @@ +## Integer options + +There is a new integer option type with optional minimum and maximum +values. It can be specified like this in the `meson_options.txt` file: + + option('integer_option', type : 'integer', min : 0, max : 5, value : 3) -- cgit v1.2.3