aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-02 19:54:27 +0200
committerGitHub <noreply@github.com>2017-12-02 19:54:27 +0200
commit793fc002fa3c414cee20b3b3a4397eeb3ce3d35e (patch)
tree6d299980e2bdb44823e3dd109037241a5f8498df /docs/markdown/snippets
parente1bdc098ca48990322b058e2a2a9fce16c3e7674 (diff)
parentc9351ce30c03d107279090da7825096951a705d3 (diff)
downloadmeson-793fc002fa3c414cee20b3b3a4397eeb3ce3d35e.zip
meson-793fc002fa3c414cee20b3b3a4397eeb3ce3d35e.tar.gz
meson-793fc002fa3c414cee20b3b3a4397eeb3ce3d35e.tar.bz2
Merge pull request #2390 from dcbaker/submit/options-list
Add an array type to user options
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/option-array-type.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/markdown/snippets/option-array-type.md b/docs/markdown/snippets/option-array-type.md
new file mode 100644
index 0000000..f073dc1
--- /dev/null
+++ b/docs/markdown/snippets/option-array-type.md
@@ -0,0 +1,17 @@
+# An array type for user options
+
+Previously to have an option that took more than one value a string value would
+have to be created and split, but validating this was difficult. A new array type
+has been added to the meson_options.txt for this case. It works like a 'combo', but
+allows more than one option to be passed. When used on the command line (with -D),
+values are passed as a comma separated list.
+
+```meson
+option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one'])
+```
+
+These can be overwritten on the command line,
+
+```meson
+meson _build -Darray_opt=two,three
+```