aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/ccrx.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2023-07-17 00:29:37 +0300
committerGitHub <noreply@github.com>2023-07-17 00:29:37 +0300
commit0dba7340ecfbe84231a14559ef7f9e7dfb7d1299 (patch)
treeade6d93a8c93bfbfe9df8de6796c93588e3fe080 /mesonbuild/compilers/mixins/ccrx.py
parentb60ea0851b1dfe4400dc2d12b127300b1da41105 (diff)
parent9b86c67e19b91eee065c1e3706ad5521801022da (diff)
downloadmeson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.zip
meson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.tar.gz
meson-0dba7340ecfbe84231a14559ef7f9e7dfb7d1299.tar.bz2
Merge pull request #11976 from tristan957/cleanups
Some various type related cleanups
Diffstat (limited to 'mesonbuild/compilers/mixins/ccrx.py')
-rw-r--r--mesonbuild/compilers/mixins/ccrx.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/mesonbuild/compilers/mixins/ccrx.py b/mesonbuild/compilers/mixins/ccrx.py
index 1c22214..71c1033 100644
--- a/mesonbuild/compilers/mixins/ccrx.py
+++ b/mesonbuild/compilers/mixins/ccrx.py
@@ -31,35 +31,35 @@ else:
# do). This gives up DRYer type checking, with no runtime impact
Compiler = object
-ccrx_buildtype_args = {
+ccrx_buildtype_args: T.Dict[str, T.List[str]] = {
'plain': [],
'debug': [],
'debugoptimized': [],
'release': [],
'minsize': [],
'custom': [],
-} # type: T.Dict[str, T.List[str]]
+}
-ccrx_optimization_args = {
+ccrx_optimization_args: T.Dict[str, T.List[str]] = {
'0': ['-optimize=0'],
'g': ['-optimize=0'],
'1': ['-optimize=1'],
'2': ['-optimize=2'],
'3': ['-optimize=max'],
's': ['-optimize=2', '-size']
-} # type: T.Dict[str, T.List[str]]
+}
-ccrx_debug_args = {
+ccrx_debug_args: T.Dict[bool, T.List[str]] = {
False: [],
True: ['-debug']
-} # type: T.Dict[bool, T.List[str]]
+}
class CcrxCompiler(Compiler):
if T.TYPE_CHECKING:
is_cross = True
- can_compile_suffixes = set() # type: T.Set[str]
+ can_compile_suffixes: T.Set[str] = set()
id = 'ccrx'
@@ -68,12 +68,13 @@ class CcrxCompiler(Compiler):
raise EnvironmentException('ccrx supports only cross-compilation.')
# Assembly
self.can_compile_suffixes.add('src')
- default_warn_args = [] # type: T.List[str]
- self.warn_args = {'0': [],
- '1': default_warn_args,
- '2': default_warn_args + [],
- '3': default_warn_args + [],
- 'everything': default_warn_args + []} # type: T.Dict[str, T.List[str]]
+ default_warn_args: T.List[str] = []
+ self.warn_args: T.Dict[str, T.List[str]] = {
+ '0': [],
+ '1': default_warn_args,
+ '2': default_warn_args + [],
+ '3': default_warn_args + [],
+ 'everything': default_warn_args + []}
def get_pic_args(self) -> T.List[str]:
# PIC support is not enabled by default for CCRX,
@@ -109,7 +110,7 @@ class CcrxCompiler(Compiler):
@classmethod
def _unix_args_to_native(cls, args: T.List[str], info: MachineInfo) -> T.List[str]:
- result = []
+ result: T.List[str] = []
for i in args:
if i.startswith('-D'):
i = '-define=' + i[2:]