From 1dc13e9951a5ce38edb93718ab5ac7b1bf6616d0 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Tue, 10 Aug 2021 18:02:39 -0500 Subject: Add unset_variable() This should be useful for helping to control variable scope within Meson. CMake has something similar for controlling scope. --- docs/markdown/snippets/unset_variable.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/markdown/snippets/unset_variable.md (limited to 'docs/markdown/snippets') 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 +``` -- cgit v1.1