diff options
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/Reference-manual.md | 11 | ||||
-rw-r--r-- | docs/markdown/snippets/unset_variable.md | 16 |
2 files changed, 27 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 81a6daf..6454830 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1852,6 +1852,17 @@ Defined tests can be run in a backend-agnostic way by calling `meson test` inside the build dir, or by using backend-specific commands, such as `ninja test` or `msbuild RUN_TESTS.vcxproj`. +### unset_variable() + +*(since 0.60.0)* + +```meson + void unset_variable(varname) +``` + +Unsets a variable. Referencing a variable which has been unset is an error until +it has been set again. + ### vcs_tag() ``` meson diff --git a/docs/markdown/snippets/unset_variable.md b/docs/markdown/snippets/unset_variable.md new file mode 100644 index 0000000..7b2bcdb --- /dev/null +++ b/docs/markdown/snippets/unset_variable.md @@ -0,0 +1,16 @@ +## `unset_variable()` + +`unset_variable()` can be used to unset a variable. Reading a variable after +calling `unset_variable()` will raise an exception unless the variable is set +again. + +```meson +# tests/meson.build +tests = ['test1', 'test2'] + +# ... + +unset_variable('tests') + +# tests is no longer usable until it is set again +``` |