From 615686fd6dc39c517952c0f9f5fb208e913d8887 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 2 Dec 2020 09:57:47 -0800 Subject: [PATCH] use new optionkey.is_* methods --- mesonbuild/ast/introspection.py | 2 +- mesonbuild/coredata.py | 2 +- mesonbuild/interpreter.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 086174805..030ca8b18 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -125,7 +125,7 @@ class IntrospectionInterpreter(AstInterpreter): self.do_subproject(i) self.coredata.init_backend_options(self.backend) - options = {k: v for k, v in self.environment.options.items() if k.name.startswith('backend_')} + options = {k: v for k, v in self.environment.options.items() if k.is_backend()} self.coredata.set_options(options) self._add_languages(proj_langs, MachineChoice.HOST) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 263d2fec5..eae986dae 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -89,7 +89,7 @@ class OptionKey: internally easier to reason about and produce. """ - __slots__ = ['name', 'subproject', 'machine', 'lang', '_hash', '_type'] + __slots__ = ['name', 'subproject', 'machine', 'lang', '_hash', 'type'] name: str subproject: str diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index a266e1f70..e6936e4ec 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -3142,7 +3142,7 @@ external dependencies (including libraries) must go to "dependencies".''') if self.environment.first_invocation: self.coredata.init_backend_options(backend) - options = {k: v for k, v in self.environment.options.items() if k.name.startswith('backend_')} + options = {k: v for k, v in self.environment.options.items() if k.is_backend()} self.coredata.set_options(options) @stringArgs