diff options
Diffstat (limited to 'mesonbuild/compilers/mixins/arm.py')
| -rw-r--r-- | mesonbuild/compilers/mixins/arm.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/mesonbuild/compilers/mixins/arm.py b/mesonbuild/compilers/mixins/arm.py index 28708d521..d15faec40 100644 --- a/mesonbuild/compilers/mixins/arm.py +++ b/mesonbuild/compilers/mixins/arm.py @@ -16,13 +16,13 @@ import os import re -import typing +import typing as T from ... import mesonlib from ..compilers import clike_debug_args from .clang import clang_color_args -if typing.TYPE_CHECKING: +if T.TYPE_CHECKING: from ...environment import Environment arm_buildtype_args = { @@ -32,7 +32,7 @@ arm_buildtype_args = { 'release': ['-O3', '-Otime'], 'minsize': ['-O3', '-Ospace'], 'custom': [], -} # type: typing.Dict[str, typing.List[str]] +} # type: T.Dict[str, T.List[str]] arm_optimization_args = { '0': ['-O0'], @@ -41,7 +41,7 @@ arm_optimization_args = { '2': ['-O2'], '3': ['-O3'], 's': [], -} # type: typing.Dict[str, typing.List[str]] +} # type: T.Dict[str, T.List[str]] armclang_buildtype_args = { 'plain': [], @@ -50,7 +50,7 @@ armclang_buildtype_args = { 'release': ['-Os'], 'minsize': ['-Oz'], 'custom': [], -} # type: typing.Dict[str, typing.List[str]] +} # type: T.Dict[str, T.List[str]] armclang_optimization_args = { '0': ['-O0'], @@ -59,7 +59,7 @@ armclang_optimization_args = { '2': ['-O2'], '3': ['-O3'], 's': ['-Os'] -} # type: typing.Dict[str, typing.List[str]] +} # type: T.Dict[str, T.List[str]] class ArmCompiler: @@ -68,7 +68,7 @@ class ArmCompiler: if not self.is_cross: raise mesonlib.EnvironmentException('armcc supports only cross-compilation.') self.id = 'arm' - default_warn_args = [] # type: typing.List[str] + default_warn_args = [] # type: T.List[str] self.warn_args = {'0': [], '1': default_warn_args, '2': default_warn_args + [], @@ -76,22 +76,22 @@ class ArmCompiler: # Assembly self.can_compile_suffixes.add('s') - def get_pic_args(self) -> typing.List[str]: + def get_pic_args(self) -> T.List[str]: # FIXME: Add /ropi, /rwpi, /fpic etc. qualifiers to --apcs return [] - def get_buildtype_args(self, buildtype: str) -> typing.List[str]: + def get_buildtype_args(self, buildtype: str) -> T.List[str]: return arm_buildtype_args[buildtype] # Override CCompiler.get_always_args - def get_always_args(self) -> typing.List[str]: + def get_always_args(self) -> T.List[str]: return [] # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: return [] - 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]: # FIXME: Add required arguments # NOTE from armcc user guide: # "Support for Precompiled Header (PCH) files is deprecated from ARM Compiler 5.05 @@ -106,19 +106,19 @@ class ArmCompiler: # PCH files." return 'pch' - def thread_flags(self, env: 'Environment') -> typing.List[str]: + def thread_flags(self, env: 'Environment') -> T.List[str]: return [] - def get_coverage_args(self) -> typing.List[str]: + def get_coverage_args(self) -> T.List[str]: return [] - def get_optimization_args(self, optimization_level: str) -> typing.List[str]: + def get_optimization_args(self, optimization_level: str) -> T.List[str]: return arm_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> typing.List[str]: + def get_debug_args(self, is_debug: bool) -> T.List[str]: return clike_debug_args[is_debug] - def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: + 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): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) @@ -159,37 +159,37 @@ class ArmclangCompiler: # Assembly self.can_compile_suffixes.update('s') - def get_pic_args(self) -> typing.List[str]: + def get_pic_args(self) -> T.List[str]: # PIC support is not enabled by default for ARM, # if users want to use it, they need to add the required arguments explicitly return [] - def get_colorout_args(self, colortype: str) -> typing.List[str]: + def get_colorout_args(self, colortype: str) -> T.List[str]: return clang_color_args[colortype][:] - def get_buildtype_args(self, buildtype: str) -> typing.List[str]: + def get_buildtype_args(self, buildtype: str) -> T.List[str]: return armclang_buildtype_args[buildtype] def get_pch_suffix(self) -> str: return 'gch' - 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]: # Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136 # This flag is internal to Clang (or at least not documented on the man page) # so it might change semantics at any time. return ['-include-pch', os.path.join(pch_dir, self.get_pch_name(header))] # Override CCompiler.get_dependency_gen_args - def get_dependency_gen_args(self, outtarget: str, outfile: str) -> typing.List[str]: + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: return [] - def get_optimization_args(self, optimization_level: str) -> typing.List[str]: + def get_optimization_args(self, optimization_level: str) -> T.List[str]: return armclang_optimization_args[optimization_level] - def get_debug_args(self, is_debug: bool) -> typing.List[str]: + def get_debug_args(self, is_debug: bool) -> T.List[str]: return clike_debug_args[is_debug] - def compute_parameters_with_absolute_paths(self, parameter_list: typing.List[str], build_dir: str) -> typing.List[str]: + 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): if i[:2] == '-I' or i[:2] == '-L': parameter_list[idx] = i[:2] + os.path.normpath(os.path.join(build_dir, i[2:])) |
