diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-02-21 21:23:43 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-01 12:13:24 -0800 |
commit | d39b3300753dca459f300e29fad7d8f74013c721 (patch) | |
tree | b6d0fc539d7fdf8935523692ab712b3317aa4229 /mesonbuild/interpreter/interpreterobjects.py | |
parent | 2b04e8c5e5c9e65a50b379ed8101139885c44a89 (diff) | |
download | meson-d39b3300753dca459f300e29fad7d8f74013c721.zip meson-d39b3300753dca459f300e29fad7d8f74013c721.tar.gz meson-d39b3300753dca459f300e29fad7d8f74013c721.tar.bz2 |
clean up FeatureCheck signature to move location to use time
The point of a .use() function is because we don't always have the
information we need to use a feature check, so we allow creating the
feature and then storing it for later use. When implementing location
checks, although it is optional, actually using it violated that design.
Move the location out of the init method for FeatureCheck itself. It
remains compatible with all cases of .single_use(), but fix the rest up.
Diffstat (limited to 'mesonbuild/interpreter/interpreterobjects.py')
-rw-r--r-- | mesonbuild/interpreter/interpreterobjects.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py index 4520f09..c7ddb38 100644 --- a/mesonbuild/interpreter/interpreterobjects.py +++ b/mesonbuild/interpreter/interpreterobjects.py @@ -253,7 +253,7 @@ class EnvironmentVariablesHolder(ObjectHolder[build.EnvironmentVariables], Mutab # Multiple append/prepend operations was not supported until 0.58.0. if self.held_object.has_name(name): m = f'Overriding previous value of environment variable {name!r} with a new one' - FeatureNew(m, '0.58.0', location=self.current_node).use(self.subproject) + FeatureNew(m, '0.58.0').use(self.subproject, self.current_node) @typed_pos_args('environment.set', str, varargs=str, min_varargs=1) @typed_kwargs('environment.set', ENV_SEPARATOR_KW) @@ -480,7 +480,7 @@ class DependencyHolder(ObjectHolder[Dependency]): def variable_method(self, args: T.Tuple[T.Optional[str]], kwargs: 'kwargs.DependencyGetVariable') -> T.Union[str, T.List[str]]: default_varname = args[0] if default_varname is not None: - FeatureNew('Positional argument to dependency.get_variable()', '0.58.0', location=self.current_node).use(self.subproject) + FeatureNew('Positional argument to dependency.get_variable()', '0.58.0').use(self.subproject, self.current_node) return self.held_object.get_variable( cmake=kwargs['cmake'] or default_varname, pkgconfig=kwargs['pkgconfig'] or default_varname, |