aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
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
+```