diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-01-06 15:27:38 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-01-08 15:28:17 +0100 |
commit | 09b53c534f74806ebc49bb2fcdfbae0e3b26fb84 (patch) | |
tree | 4466a6005333d6d1ae7d67cbaf24fb63e104df6a /mesonbuild/compilers/mixins/intel.py | |
parent | f3199edaf8802e2a59fed2f83e825e09b9d4bd0d (diff) | |
download | meson-09b53c534f74806ebc49bb2fcdfbae0e3b26fb84.zip meson-09b53c534f74806ebc49bb2fcdfbae0e3b26fb84.tar.gz meson-09b53c534f74806ebc49bb2fcdfbae0e3b26fb84.tar.bz2 |
types: import typing as T (fixes #6333)
Diffstat (limited to 'mesonbuild/compilers/mixins/intel.py')
-rw-r--r-- | mesonbuild/compilers/mixins/intel.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/mesonbuild/compilers/mixins/intel.py b/mesonbuild/compilers/mixins/intel.py index 91edecd..fbbfdc5 100644 --- a/mesonbuild/compilers/mixins/intel.py +++ b/mesonbuild/compilers/mixins/intel.py @@ -21,13 +21,13 @@ is IntelVisualStudioLikeCompiler. """ import os -import typing +import typing as T from ... import mesonlib from .gnu import GnuLikeCompiler from .visualstudio import VisualStudioLikeCompiler -if typing.TYPE_CHECKING: +if T.TYPE_CHECKING: import subprocess # noqa: F401 # XXX: avoid circular dependencies @@ -58,7 +58,7 @@ class IntelGnuLikeCompiler(GnuLikeCompiler): 'release': [], 'minsize': [], 'custom': [], - } # type: typing.Dict[str, typing.List[str]] + } # type: T.Dict[str, T.List[str]] OPTIM_ARGS = { '0': ['-O0'], @@ -84,20 +84,20 @@ class IntelGnuLikeCompiler(GnuLikeCompiler): def get_pch_suffix(self) -> str: return 'pchi' - def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: + def get_pch_use_args(self, pch_dir: str, header: str) -> T.List[str]: return ['-pch', '-pch_dir', os.path.join(pch_dir), '-x', self.lang_header, '-include', header, '-x', 'none'] def get_pch_name(self, header_name: str) -> str: return os.path.basename(header_name) + '.' + self.get_pch_suffix() - def openmp_flags(self) -> typing.List[str]: + def openmp_flags(self) -> T.List[str]: if mesonlib.version_compare(self.version, '>=15.0.0'): return ['-qopenmp'] else: return ['-openmp'] - def compiles(self, *args, **kwargs) -> typing.Tuple[bool, bool]: + def compiles(self, *args, **kwargs) -> T.Tuple[bool, bool]: # This covers a case that .get('foo', []) doesn't, that extra_args is # defined and is None extra_args = kwargs.get('extra_args') or [] @@ -113,16 +113,16 @@ class IntelGnuLikeCompiler(GnuLikeCompiler): ] return super().compiles(*args, **kwargs) - def get_profile_generate_args(self) -> typing.List[str]: + def get_profile_generate_args(self) -> T.List[str]: return ['-prof-gen=threadsafe'] - def get_profile_use_args(self) -> typing.List[str]: + def get_profile_use_args(self) -> T.List[str]: return ['-prof-use'] - def get_buildtype_args(self, buildtype: str) -> typing.List[str]: + def get_buildtype_args(self, buildtype: str) -> T.List[str]: return self.BUILD_ARGS[buildtype] - def get_optimization_args(self, optimization_level: str) -> typing.List[str]: + def get_optimization_args(self, optimization_level: str) -> T.List[str]: return self.OPTIM_ARGS[optimization_level] @@ -137,7 +137,7 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): 'release': [], 'minsize': [], 'custom': [], - } # type: typing.Dict[str, typing.List[str]] + } # type: T.Dict[str, T.List[str]] OPTIM_ARGS = { '0': ['/O0'], @@ -152,7 +152,7 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): super().__init__(target) self.id = 'intel-cl' - def compile(self, code, *, extra_args: typing.Optional[typing.List[str]] = None, **kwargs) -> typing.Iterator['subprocess.Popen']: + def compile(self, code, *, extra_args: T.Optional[T.List[str]] = None, **kwargs) -> T.Iterator['subprocess.Popen']: # This covers a case that .get('foo', []) doesn't, that extra_args is if kwargs.get('mode', 'compile') != 'link': extra_args = extra_args.copy() if extra_args is not None else [] @@ -166,7 +166,7 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): ]) return super().compile(code, extra_args, **kwargs) - def get_toolset_version(self) -> typing.Optional[str]: + def get_toolset_version(self) -> T.Optional[str]: # Avoid circular dependencies.... from ...environment import search_version @@ -178,11 +178,11 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): version = int(v1 + v2) return self._calculate_toolset_version(version) - def openmp_flags(self) -> typing.List[str]: + def openmp_flags(self) -> T.List[str]: return ['/Qopenmp'] - def get_buildtype_args(self, buildtype: str) -> typing.List[str]: + def get_buildtype_args(self, buildtype: str) -> T.List[str]: return self.BUILD_ARGS[buildtype] - def get_optimization_args(self, optimization_level: str) -> typing.List[str]: + def get_optimization_args(self, optimization_level: str) -> T.List[str]: return self.OPTIM_ARGS[optimization_level] |