diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-03-12 11:14:28 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-04-08 10:00:16 -0700 |
| commit | aa8f9229fc76e5d89da04495f3b188f4438de32e (patch) | |
| tree | 35113b05aba6c7ea82c6fe3559782107ffffd879 /mesonbuild/ast/introspection.py | |
| parent | 9d1837e1afc919d18645c8fd6788cf44ac7d078d (diff) | |
| download | meson-aa8f9229fc76e5d89da04495f3b188f4438de32e.tar.gz | |
coredata: delete set_default_options
This was only being used by the introspection interpreter, which meant
the two interpreters had different behavior. They still do, which is
really bad because the IntrospectionInterpreter doesn't have the command
line options or project_default_options. I have a plan to fix that
later, and I don't want to spend time on it here, as it's not a
regression of this patch, it's just the status quo.
This also fixes an issue caused by dead code being left, and hit, due to
the option refactor branch.
Fixes: #14382
Diffstat (limited to 'mesonbuild/ast/introspection.py')
| -rw-r--r-- | mesonbuild/ast/introspection.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 0d6470adc..4eb3fec3e 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -119,7 +119,19 @@ class IntrospectionInterpreter(AstInterpreter): string_dict = cdata.create_options_dict(_project_default_options, self.subproject) self.project_default_options = {OptionKey(s): v for s, v in string_dict.items()} self.default_options.update(self.project_default_options) - self.coredata.set_default_options(self.default_options, self.subproject, self.environment) + if self.environment.first_invocation or (self.subproject != '' and self.subproject not in self.coredata.initialized_subprojects): + if self.subproject == '': + self.coredata.optstore.initialize_from_top_level_project_call( + T.cast('T.Dict[T.Union[OptionKey, str], str]', string_dict), + {}, # TODO: not handled by this Interpreter. + self.environment.options) + else: + self.coredata.optstore.initialize_from_subproject_call( + self.subproject, + {}, # TODO: this isn't handled by the introspection interpreter... + T.cast('T.Dict[T.Union[OptionKey, str], str]', string_dict), + {}) # TODO: this isn't handled by the introspection interpreter... + self.coredata.initialized_subprojects.add(self.subproject) if not self.is_subproject() and 'subproject_dir' in kwargs: spdirname = kwargs['subproject_dir'] |
