aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2022-10-23 21:54:47 -0400
committerXavier Claessens <xclaesse@gmail.com>2022-10-24 11:17:18 +0200
commit9c4d6088b1f061c7cd8dba00eda5e72427ad3d0e (patch)
tree97e8bcdd609a78870c21f580600939ea7a358c69 /mesonbuild/interpreter/interpreter.py
parent4f4076bfc0dacbc5f804ad2d970054ab43d162b3 (diff)
downloadmeson-9c4d6088b1f061c7cd8dba00eda5e72427ad3d0e.zip
meson-9c4d6088b1f061c7cd8dba00eda5e72427ad3d0e.tar.gz
meson-9c4d6088b1f061c7cd8dba00eda5e72427ad3d0e.tar.bz2
Accept disablers in summary values
They are commonly used as a replacement for a `dependency`, and not accepting them in `summary` breaks the last example in [1] when used as a value. [1] https://mesonbuild.com/Disabler.html#disabling-parts-of-the-build
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 7e80d23..7f4c182 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -166,11 +166,14 @@ class Summary:
elif isinstance(i, (ExternalProgram, Dependency)):
FeatureNew.single_use('dependency or external program in summary', '0.57.0', subproject)
formatted_values.append(i.summary_value())
+ elif isinstance(i, Disabler):
+ FeatureNew.single_use('disabler in summary', '0.64.0', subproject)
+ formatted_values.append(mlog.red('NO'))
elif isinstance(i, coredata.UserOption):
FeatureNew.single_use('feature option in summary', '0.58.0', subproject)
formatted_values.append(i.printable_value())
else:
- m = 'Summary value in section {!r}, key {!r}, must be string, integer, boolean, dependency or external program'
+ m = 'Summary value in section {!r}, key {!r}, must be string, integer, boolean, dependency, disabler, or external program'
raise InterpreterException(m.format(section, k))
self.sections[section][k] = (formatted_values, list_sep)
self.max_key_len = max(self.max_key_len, len(k))