diff --git a/mesonbuild/backend/vs2017backend.py b/mesonbuild/backend/vs2017backend.py index bf6c33771..0f891fec4 100644 --- a/mesonbuild/backend/vs2017backend.py +++ b/mesonbuild/backend/vs2017backend.py @@ -11,7 +11,9 @@ from .vs2010backend import Vs2010Backend from ..mesonlib import MesonException if T.TYPE_CHECKING: + from ..arglist import CompilerArgs from ..build import Build + from ..compilers.compilers import Language class Vs2017Backend(Vs2010Backend): @@ -45,11 +47,11 @@ class Vs2017Backend(Vs2010Backend): if sdk_version: self.windows_target_platform_version = sdk_version.rstrip('\\') - def generate_debug_information(self, link): + def generate_debug_information(self, link: ET.Element) -> None: # valid values for vs2017 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' - def generate_lang_standard_info(self, file_args, clconf): + def generate_lang_standard_info(self, file_args: T.Dict[Language, CompilerArgs], clconf: ET.Element) -> None: if 'cpp' in file_args: optargs = [x for x in file_args['cpp'] if x.startswith('/std:c++')] if optargs: diff --git a/mesonbuild/backend/vs2019backend.py b/mesonbuild/backend/vs2019backend.py index bf86a4701..b6cc0a382 100644 --- a/mesonbuild/backend/vs2019backend.py +++ b/mesonbuild/backend/vs2019backend.py @@ -10,7 +10,9 @@ import xml.etree.ElementTree as ET from .vs2010backend import Vs2010Backend if T.TYPE_CHECKING: + from ..arglist import CompilerArgs from ..build import Build + from ..compilers.compilers import Language class Vs2019Backend(Vs2010Backend): @@ -40,11 +42,11 @@ class Vs2019Backend(Vs2010Backend): if sdk_version: self.windows_target_platform_version = sdk_version.rstrip('\\') - def generate_debug_information(self, link): + def generate_debug_information(self, link: ET.Element) -> None: # valid values for vs2019 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' - def generate_lang_standard_info(self, file_args, clconf): + def generate_lang_standard_info(self, file_args: T.Dict[Language, CompilerArgs], clconf: ET.Element) -> None: if 'cpp' in file_args: optargs = [x for x in file_args['cpp'] if x.startswith('/std:c++')] if optargs: diff --git a/mesonbuild/backend/vs2022backend.py b/mesonbuild/backend/vs2022backend.py index d7de4be32..b6aaf3c70 100644 --- a/mesonbuild/backend/vs2022backend.py +++ b/mesonbuild/backend/vs2022backend.py @@ -10,7 +10,9 @@ import xml.etree.ElementTree as ET from .vs2010backend import Vs2010Backend if T.TYPE_CHECKING: + from ..arglist import CompilerArgs from ..build import Build + from ..compilers.compilers import Language class Vs2022Backend(Vs2010Backend): @@ -40,11 +42,11 @@ class Vs2022Backend(Vs2010Backend): if sdk_version: self.windows_target_platform_version = sdk_version.rstrip('\\') - def generate_debug_information(self, link): + def generate_debug_information(self, link: ET.Element) -> None: # valid values for vs2022 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' - def generate_lang_standard_info(self, file_args, clconf): + def generate_lang_standard_info(self, file_args: T.Dict[Language, CompilerArgs], clconf: ET.Element) -> None: if 'cpp' in file_args: optargs = [x for x in file_args['cpp'] if x.startswith('/std:c++')] if optargs: diff --git a/mesonbuild/backend/vs2026backend.py b/mesonbuild/backend/vs2026backend.py index ba24d8ac4..5b3eea9ae 100644 --- a/mesonbuild/backend/vs2026backend.py +++ b/mesonbuild/backend/vs2026backend.py @@ -10,7 +10,9 @@ import xml.etree.ElementTree as ET from .vs2010backend import Vs2010Backend if T.TYPE_CHECKING: + from ..arglist import CompilerArgs from ..build import Build + from ..compilers.compilers import Language class Vs2026Backend(Vs2010Backend): @@ -40,11 +42,11 @@ class Vs2026Backend(Vs2010Backend): if sdk_version: self.windows_target_platform_version = sdk_version.rstrip('\\') - def generate_debug_information(self, link): + def generate_debug_information(self, link: ET.Element) -> None: # valid values for vs2026 is 'false', 'true', 'DebugFastLink', 'DebugFull' ET.SubElement(link, 'GenerateDebugInformation').text = 'DebugFull' - def generate_lang_standard_info(self, file_args, clconf): + def generate_lang_standard_info(self, file_args: T.Dict[Language, CompilerArgs], clconf: ET.Element) -> None: if 'cpp' in file_args: optargs = [x for x in file_args['cpp'] if x.startswith('/std:c++')] if optargs: diff --git a/run_mypy.py b/run_mypy.py index be8f5592d..bce6775e2 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -34,6 +34,14 @@ modules = [ 'mesonbuild/backend/backends.py', 'mesonbuild/backend/ninjabackend.py', 'mesonbuild/backend/nonebackend.py', + 'mesonbuild/backend/vs2010backend.py', + 'mesonbuild/backend/vs2012backend.py', + 'mesonbuild/backend/vs2013backend.py', + 'mesonbuild/backend/vs2015backend.py', + 'mesonbuild/backend/vs2017backend.py', + 'mesonbuild/backend/vs2019backend.py', + 'mesonbuild/backend/vs2022backend.py', + 'mesonbuild/backend/vs2026backend.py', 'mesonbuild/cmdline.py', 'mesonbuild/coredata.py', 'mesonbuild/depfile.py',