interpreter: use typed_kwargs for build_target.native

pull/12392/head
Dylan Baker 1 year ago
parent 2fc8729078
commit 357abf51c5
  1. 2
      mesonbuild/interpreter/interpreter.py
  2. 1
      mesonbuild/interpreter/kwargs.py
  3. 1
      mesonbuild/interpreter/type_checking.py
  4. 2
      mesonbuild/modules/python.py

@ -3300,7 +3300,7 @@ class Interpreter(InterpreterBase, HoldableObject):
build_target_decorator_caller(self, node, args, kwargs)
name, sources = args
for_machine = self.machine_from_native_kwarg(kwargs)
for_machine = kwargs['native']
if kwargs.get('rust_crate_type') == 'proc-macro':
# Silently force to native because that's the only sensible value
# and rust_crate_type is deprecated any way.

@ -328,6 +328,7 @@ class _BaseBuildTarget(TypedDict):
build_by_default: bool
install: bool
install_mode: FileMode
native: MachineChoice
override_options: T.Dict[OptionKey, T.Union[str, int, bool, T.List[str]]]
depend_files: NotRequired[T.List[File]]

@ -555,6 +555,7 @@ _ALL_TARGET_KWS: T.List[KwargInfo] = [
KwargInfo('build_by_default', bool, default=True, since='0.38.0'),
INSTALL_KW,
INSTALL_MODE_KW,
NATIVE_KW,
]
# Applies to all build_target classes except jar

@ -197,7 +197,7 @@ class PythonInstallation(_ExternalProgramHolder['PythonExternalProgram']):
# into the linker path when not running in debug mode via a series #pragma comment(lib, "")
# directives. We manually override these here as this interferes with the intended
# use of the 'limited_api' kwarg
for_machine = self.interpreter.machine_from_native_kwarg(kwargs)
for_machine = kwargs['native']
compilers = self.interpreter.environment.coredata.compilers[for_machine]
if any(compiler.get_id() == 'msvc' for compiler in compilers.values()):
pydep_copy = copy.copy(pydep)

Loading…
Cancel
Save