From 5a7427cebb9093387f3f5e202b033db2516f9b30 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Fri, 23 Sep 2022 14:30:23 -0500 Subject: [PATCH] Fix mismatched param names between Compiler and BasicLinkerIsCompilerMixin --- mesonbuild/compilers/java.py | 12 ++++++++---- mesonbuild/compilers/mixins/islinker.py | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py index 536780b27..6857ea08a 100644 --- a/mesonbuild/compilers/java.py +++ b/mesonbuild/compilers/java.py @@ -34,13 +34,20 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler): language = 'java' id = 'unknown' + _WARNING_LEVELS: T.Dict[str, T.List[str]] = { + '0': ['-nowarn'], + '1': ['-Xlint:all'], + '2': ['-Xlint:all', '-Xdoclint:all'], + '3': ['-Xlint:all', '-Xdoclint:all'], + } + def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, info: 'MachineInfo', full_version: T.Optional[str] = None): super().__init__(exelist, version, for_machine, info, full_version=full_version) self.javarunner = 'java' def get_warn_args(self, level: str) -> T.List[str]: - return ['-Xlint:all', '-Xdoclint:all'] + return self._WARNING_LEVELS[level] def get_werror_args(self) -> T.List[str]: return ['-Werror'] @@ -65,9 +72,6 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler): def get_buildtype_args(self, buildtype: str) -> T.List[str]: return java_buildtype_args[buildtype] - def get_depfile_suffix(self) -> str: - return 'd' - def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str], build_dir: str) -> T.List[str]: for idx, i in enumerate(parameter_list): diff --git a/mesonbuild/compilers/mixins/islinker.py b/mesonbuild/compilers/mixins/islinker.py index 738b456a0..9da7ae8bc 100644 --- a/mesonbuild/compilers/mixins/islinker.py +++ b/mesonbuild/compilers/mixins/islinker.py @@ -58,7 +58,7 @@ class BasicLinkerIsCompilerMixin(Compiler): def get_linker_exelist(self) -> T.List[str]: return self.exelist.copy() - def get_linker_output_args(self, output: str) -> T.List[str]: + def get_linker_output_args(self, outputname: str) -> T.List[str]: return [] def get_linker_always_args(self) -> T.List[str]: @@ -119,7 +119,7 @@ class BasicLinkerIsCompilerMixin(Compiler): def get_buildtype_linker_args(self, buildtype: str) -> T.List[str]: return [] - def get_link_debugfile_name(self, target: str) -> str: + def get_link_debugfile_name(self, targetfile: str) -> str: return '' def thread_flags(self, env: 'Environment') -> T.List[str]: