Skip to content

Commit

Permalink
[WIP] SQUASHME
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr committed Feb 7, 2024
1 parent 6e466e5 commit 9ba0d5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ def func_vcs_tag(self, node: mparser.BaseNode, args: T.List['TYPE_var'], kwargs:
tg = build.CustomTarget(
kwargs['output'][0],
self.subdir,
self.subproject,
self.subp_id,
self.environment,
cmd,
self.source_strings_to_files(kwargs['input']),
Expand Down Expand Up @@ -2098,7 +2098,7 @@ def func_custom_target(self, node: mparser.FunctionNode, args: T.Tuple[str],
tg = build.CustomTarget(
name,
self.subdir,
self.subproject,
self.subp_id,
self.environment,
command,
inputs,
Expand Down Expand Up @@ -2137,7 +2137,7 @@ def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str],
if isinstance(all_args[0], str):
all_args[0] = self.find_program_impl([all_args[0]])
name = args[0]
tg = build.RunTarget(name, all_args, kwargs['depends'], self.subdir, self.subproject, self.environment,
tg = build.RunTarget(name, all_args, kwargs['depends'], self.subdir, self.subp_id, self.environment,
kwargs['env'])
self.add_target(name, tg)
return tg
Expand All @@ -2148,7 +2148,7 @@ def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str],
def func_alias_target(self, node: mparser.BaseNode, args: T.Tuple[str, T.List[build.Target]],
kwargs: 'TYPE_kwargs') -> build.AliasTarget:
name, deps = args
tg = build.AliasTarget(name, deps, self.subdir, self.subproject, self.environment)
tg = build.AliasTarget(name, deps, self.subdir, self.subp_id, self.environment)
self.add_target(name, tg)
return tg

Expand Down Expand Up @@ -2972,9 +2972,9 @@ def _add_global_arguments(self, node: mparser.FunctionNode, argsdict: T.Dict[str

def _add_project_arguments(self, node: mparser.FunctionNode, argsdict: T.Dict[str, T.Dict[str, T.List[str]]],
args: T.List[str], kwargs: 'kwtypes.FuncAddProjectArgs') -> None:
if self.subproject not in argsdict:
argsdict[self.subproject] = {}
self._add_arguments(node, argsdict[self.subproject],
if self.subp_id not in argsdict:
argsdict[self.subp_id] = {}
self._add_arguments(node, argsdict[self.subp_id],
self.project_args_frozen, args, kwargs)

def _add_arguments(self, node: mparser.FunctionNode, argsdict: T.Dict[str, T.List[str]],
Expand Down Expand Up @@ -3326,6 +3326,9 @@ def build_target(self, node: mparser.BaseNode, args: T.Tuple[str, SourcesVarargs
# Silently force to native because that's the only sensible value
# and rust_crate_type is deprecated any way.
for_machine = MachineChoice.BUILD
elif self.environment.is_native_clone:
for_machine = MachineChoice.BUILD
kwargs['install'] = False
# Avoid mutating, since there could be other references to sources
sources = sources + kwargs['sources']
if any(isinstance(s, build.BuildTarget) for s in sources):
Expand Down Expand Up @@ -3433,7 +3436,7 @@ def build_target(self, node: mparser.BaseNode, args: T.Tuple[str, SourcesVarargs
if kwargs['implib'] is None:
kwargs['implib'] = False

target = targetclass(name, self.subdir, self.subproject, for_machine, srcs, struct, objs,
target = targetclass(name, self.subdir, self.subp_id, for_machine, srcs, struct, objs,
self.environment, self.compilers[for_machine], kwargs)

self.add_target(name, target)
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, interpreter: 'Interpreter') -> None:
self.headers = interpreter.build.get_headers()
self.man = interpreter.build.get_man()
self.global_args = interpreter.build.global_args.host
self.project_args = interpreter.build.projects_args.host.get(interpreter.subproject, {})
self.project_args = interpreter.build.projects_args.host.get(interpreter.subp_id, {})
self.current_node = interpreter.current_node

def get_include_args(self, include_dirs: T.Iterable[T.Union[str, build.IncludeDirs]], prefix: str = '-I') -> T.List[str]:
Expand Down

0 comments on commit 9ba0d5b

Please sign in to comment.