Skip to content

Commit

Permalink
[WIP] SQUASHME
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Feb 6, 2024
1 parent 20e8d28 commit 22c02b6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ def __init__(
self,
_build: build.Build,
backend: T.Optional[Backend] = None,
subproject: str = '',
subp_name: str = '',
subp_id: str = '',
subdir: str = '',
subproject_dir: str = 'subprojects',
default_project_options: T.Optional[T.Dict[OptionKey, str]] = None,
Expand All @@ -271,14 +272,16 @@ def __init__(
relaxations: T.Optional[T.Set[InterpreterRuleRelaxation]] = None,
user_defined_options: T.Optional['argparse.Namespace'] = None,
) -> None:
super().__init__(_build.environment.get_source_dir(), subdir, subproject)
super().__init__(_build.environment.get_source_dir(), subdir, subp_name)

self.active_projectname = ''
self.build = _build
self.environment = self.build.environment
self.coredata = self.environment.get_coredata()
self.backend = backend
self.summary: T.Dict[str, 'Summary'] = {}
self.modules: T.Dict[str, NewExtensionModule] = {}
self.subp_id = subp_id
# Subproject directory is usually the name of the subproject, but can
# be different for dependencies provided by wrap files.
self.subproject_directory_name = subdir.split(os.path.sep)[-1]
Expand Down Expand Up @@ -974,7 +977,7 @@ def _do_subproject_meson(self, subp_name: str, subp_id: str, subdir: str,
mlog.cmd_ci_include(meson_filename)

new_build = self.build.copy()
subi = Interpreter(new_build, self.backend, subp_id, subdir, self.subproject_dir,
subi = Interpreter(new_build, self.backend, subp_name, subp_id, subdir, self.subproject_dir,
default_options, ast=ast, is_translated=(ast is not None),
relaxations=relaxations,
user_defined_options=self.user_defined_options)
Expand Down Expand Up @@ -1377,9 +1380,9 @@ def func_summary(self, node: mparser.BaseNode, args: T.Tuple[T.Union[str, T.Dict
self.summary_impl(kwargs['section'], values, kwargs)

def summary_impl(self, section: str, values, kwargs: 'kwtypes.Summary') -> None:
if self.subproject not in self.summary:
self.summary[self.subproject] = Summary(self.active_projectname, self.project_version)
self.summary[self.subproject].add_section(
if self.subp_id not in self.summary:
self.summary[self.subp_id] = Summary(self.active_projectname, self.project_version)
self.summary[self.subp_id].add_section(
section, values, kwargs['bool_yn'], kwargs['list_sep'], self.subproject)

def _print_summary(self) -> None:
Expand Down

0 comments on commit 22c02b6

Please sign in to comment.