diff options
author | John Ericson <git@JohnEricson.me> | 2019-05-12 12:38:11 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-15 14:21:47 +0300 |
commit | 4030e7cb7ad54dd2df0686f41459fc6293c8284f (patch) | |
tree | e7366f78785419ad7d301fb68bc4b508fba9079e /mesonbuild/interpreter.py | |
parent | 7b8ef78bc0002d0327626c6218b793f87c2a5eb8 (diff) | |
download | meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.zip meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.gz meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.bz2 |
UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its
name, and also contains its own name. In general, the maxim in
programming is things shouldn't know their own name, so removed the name
field just leaving the option's position in the dictionary as its name.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index fe12a7b..1e8f972 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -60,12 +60,12 @@ def stringifyUserArguments(args): class FeatureOptionHolder(InterpreterObject, ObjectHolder): - def __init__(self, env, option): + def __init__(self, env, name, option): InterpreterObject.__init__(self) ObjectHolder.__init__(self, option) if option.is_auto(): self.held_object = env.coredata.builtins['auto_features'] - self.name = option.name + self.name = name self.methods.update({'enabled': self.enabled_method, 'disabled': self.disabled_method, 'auto': self.auto_method, @@ -2536,7 +2536,7 @@ external dependencies (including libraries) must go to "dependencies".''') 'options of other subprojects.') opt = self.get_option_internal(optname) if isinstance(opt, coredata.UserFeatureOption): - return FeatureOptionHolder(self.environment, opt) + return FeatureOptionHolder(self.environment, optname, opt) elif isinstance(opt, coredata.UserOption): return opt.value return opt |