From e81acbd6069e8c1ae8e3be7bb83ddc239009d42d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 4 Dec 2020 17:01:45 -0800 Subject: Use a single coredata dictionary for options This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually). --- mesonbuild/ast/introspection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/ast/introspection.py') diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 83b6843..97ebb5a 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -103,7 +103,7 @@ class IntrospectionInterpreter(AstInterpreter): if os.path.exists(self.option_file): oi = optinterpreter.OptionInterpreter(self.subproject) oi.process(self.option_file) - self.coredata.merge_user_options(oi.options) + self.coredata.update_project_options(oi.options) def_opts = self.flatten_args(kwargs.get('default_options', [])) _project_default_options = mesonlib.stringlistify(def_opts) @@ -269,7 +269,7 @@ class IntrospectionInterpreter(AstInterpreter): return new_target def build_library(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs: T.Dict[str, TYPE_nvar]) -> T.Optional[T.Dict[str, T.Any]]: - default_library = self.coredata.get_builtin_option('default_library') + default_library = self.coredata.get_option(OptionKey('default_library')) if default_library == 'shared': return self.build_target(node, args, kwargs, SharedLibrary) elif default_library == 'static': -- cgit v1.1