diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 108aa7295..6ed1e46c4 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2797,7 +2797,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) else: return compiler.get_compile_debugfile_args(objfile, pch=False) - def get_link_debugfile_name(self, linker, target, outname): + def get_link_debugfile_name(self, linker, target, outname) -> T.Optional[str]: return linker.get_link_debugfile_name(outname) def get_link_debugfile_args(self, linker, target, outname): diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 4cbdb1fc9..cb8eae56a 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -921,7 +921,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): def get_compile_debugfile_args(self, rel_obj: str, pch: bool = False) -> T.List[str]: return [] - def get_link_debugfile_name(self, targetfile: str) -> str: + def get_link_debugfile_name(self, targetfile: str) -> T.Optional[str]: return self.linker.get_debugfile_name(targetfile) def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: diff --git a/mesonbuild/compilers/mixins/islinker.py b/mesonbuild/compilers/mixins/islinker.py index 711e3e376..cfdd746b0 100644 --- a/mesonbuild/compilers/mixins/islinker.py +++ b/mesonbuild/compilers/mixins/islinker.py @@ -120,8 +120,8 @@ class BasicLinkerIsCompilerMixin(Compiler): def get_buildtype_linker_args(self, buildtype: str) -> T.List[str]: return [] - def get_link_debugfile_name(self, targetfile: str) -> str: - return '' + def get_link_debugfile_name(self, targetfile: str) -> T.Optional[str]: + return None def thread_flags(self, env: 'Environment') -> T.List[str]: return [] diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index 609308b2d..8f413c857 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -86,7 +86,7 @@ class StaticLinker: def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: return args[:] - def get_link_debugfile_name(self, targetfile: str) -> str: + def get_link_debugfile_name(self, targetfile: str) -> T.Optional[str]: return None def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: @@ -428,7 +428,7 @@ class DynamicLinker(metaclass=abc.ABCMeta): def has_multi_arguments(self, args: T.List[str], env: 'Environment') -> T.Tuple[bool, bool]: raise EnvironmentException(f'Language {self.id} does not support has_multi_link_arguments.') - def get_debugfile_name(self, targetfile: str) -> str: + def get_debugfile_name(self, targetfile: str) -> T.Optional[str]: '''Name of debug file written out (see below)''' return None