aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-02-21 21:49:13 -0500
committerDylan Baker <dylan@pnwbakers.com>2022-03-01 12:13:24 -0800
commit23e767176e832768d9c1f8c87efbe2bda69ee1c1 (patch)
tree824f0697352ddd9c98b69adb0d609f07d40b81e1 /mesonbuild/interpreter/interpreter.py
parentd39b3300753dca459f300e29fad7d8f74013c721 (diff)
downloadmeson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.zip
meson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.tar.gz
meson-23e767176e832768d9c1f8c87efbe2bda69ee1c1.tar.bz2
allow dependency checks to bubble up feature warnings to the interpreter
It would be too difficult and probably a layering violation to give an interpreter handle to the inner guts of every dependency. What we can do instead is let every dependency track: - the Feature checks it can produce, - the version attribute for when it was implemented while leaving the interpreter in charge of actually emitting them.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 380cc1d..2d891d9 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -1601,6 +1601,11 @@ external dependencies (including libraries) must go to "dependencies".''')
if wanted != actual:
mlog.debug(f'Current include type of {args[0]} is {actual}. Converting to requested {wanted}')
d = d.generate_system_dependency(wanted)
+ if d.feature_since is not None:
+ version, extra_msg = d.feature_since
+ FeatureNew.single_use(f'dep {d.name!r} custom lookup', version, self.subproject, extra_msg, node)
+ for f in d.featurechecks:
+ f.use(self.subproject, node)
return d
@FeatureNew('disabler', '0.44.0')