From 3589815eb9dd8402deabedcd4492f33e04870c56 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 21 Dec 2022 09:55:26 -0800 Subject: interpreter: add a feature.enable_auto_if It's always been strange to me we don't have an opposite method of the `disable_auto_if` method, but I've been pressed to find a case where we _need_ one, because `disable_auto_if` can't be logically contorted to work. I finally found the case where they're not equivalent: when you don't want to convert to a boolean: ```meson f = get_option('feat').disable_auto_if(not foo) g = get_option('feat').enable_auto_if(foo) dep1 = dependency('foo', required : f) dep2 = dependency('foo', required : g) ``` --- docs/markdown/snippets/feature_enable_auto_if.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docs/markdown/snippets/feature_enable_auto_if.md (limited to 'docs/markdown') diff --git a/docs/markdown/snippets/feature_enable_auto_if.md b/docs/markdown/snippets/feature_enable_auto_if.md new file mode 100644 index 0000000..5461004 --- /dev/null +++ b/docs/markdown/snippets/feature_enable_auto_if.md @@ -0,0 +1,4 @@ +## Feature objects now have an enable_auto_if method + +This performs the opposite task of the disable_auto_if method, enabling the +feature if the condition is true. -- cgit v1.1