aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/optinterpreter.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-07-02 18:44:36 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-07-02 19:52:53 +0530
commita1d9adba096589122aefc50fb9429ec0ce0432b9 (patch)
tree65711916a354df107ab4022a200855938bacd3a2 /mesonbuild/optinterpreter.py
parent5714ba253467d84b9cd1003b99e6596b5d86f20a (diff)
downloadmeson-a1d9adba096589122aefc50fb9429ec0ce0432b9.zip
meson-a1d9adba096589122aefc50fb9429ec0ce0432b9.tar.gz
meson-a1d9adba096589122aefc50fb9429ec0ce0432b9.tar.bz2
FeatureNew: Make all checks subproject-specific
We now pass the current subproject to every FeatureNew and FeatureDeprecated call. This requires a bunch of rework to: 1. Ensure that we have access to the subproject in the list of arguments when used as a decorator (see _get_callee_args). 2. Pass the subproject to .use() when it's called manually. 3. We also can't do feature checks for new features in meson_options.txt because that's parsed before we know the meson_version from project()
Diffstat (limited to 'mesonbuild/optinterpreter.py')
-rw-r--r--mesonbuild/optinterpreter.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py
index cd3139b..94efbcf 100644
--- a/mesonbuild/optinterpreter.py
+++ b/mesonbuild/optinterpreter.py
@@ -18,7 +18,6 @@ import functools
from . import mparser
from . import coredata
from . import mesonlib
-from .interpreterbase import FeatureNew
from . import compilers
forbidden_option_names = coredata.get_builtin_options()
@@ -94,7 +93,9 @@ def IntegerParser(name, description, kwargs):
kwargs['value'],
kwargs.get('yield', coredata.default_yielding))
-@FeatureNew('array type option()', '0.44.0')
+# FIXME: Cannot use FeatureNew while parsing options because we parse it before
+# reading options in project(). See func_project() in interpreter.py
+#@FeatureNew('array type option()', '0.44.0')
@permitted_kwargs({'value', 'yield', 'choices'})
def string_array_parser(name, description, kwargs):
if 'choices' in kwargs:
@@ -188,8 +189,11 @@ class OptionInterpreter:
raise OptionException('Only calls to option() are allowed in option files.')
(posargs, kwargs) = self.reduce_arguments(node.args)
- if 'yield' in kwargs:
- FeatureNew('option yield', '0.45.0').use()
+ # FIXME: Cannot use FeatureNew while parsing options because we parse
+ # it before reading options in project(). See func_project() in
+ # interpreter.py
+ #if 'yield' in kwargs:
+ # FeatureNew('option yield', '0.45.0').use(self.subproject)
if 'type' not in kwargs:
raise OptionException('Option call missing mandatory "type" keyword argument')