aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-07-12 17:36:25 -0500
committerTristan Partin <tristan@partin.io>2023-07-12 18:56:06 -0500
commit921c2370a722cbaa42bd256c699fae3185084939 (patch)
tree8884965e8f1e1413703f271ceba046e52647d723 /mesonbuild/compilers/compilers.py
parent1624354f33bf0a33f0e715ba1ca391ae0154ad19 (diff)
downloadmeson-921c2370a722cbaa42bd256c699fae3185084939.zip
meson-921c2370a722cbaa42bd256c699fae3185084939.tar.gz
meson-921c2370a722cbaa42bd256c699fae3185084939.tar.bz2
Replace some type comments with annotations
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py135
1 files changed, 72 insertions, 63 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 22865d8..3789363 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -190,68 +190,77 @@ class CompileCheckMode(enum.Enum):
LINK = 'link'
-cuda_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': ['-g', '-G'],
- 'debugoptimized': ['-g', '-lineinfo'],
- 'release': [],
- 'minsize': [],
- 'custom': [],
- }
-java_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': ['-g'],
- 'debugoptimized': ['-g'],
- 'release': [],
- 'minsize': [],
- 'custom': [],
- }
-
-rust_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': [],
- 'release': [],
- 'minsize': [],
- 'custom': [],
- }
-
-d_gdc_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': ['-finline-functions'],
- 'release': ['-finline-functions'],
- 'minsize': [],
- 'custom': [],
- }
-
-d_ldc_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': ['-enable-inlining', '-Hkeep-all-bodies'],
- 'release': ['-enable-inlining', '-Hkeep-all-bodies'],
- 'minsize': [],
- 'custom': [],
- }
-
-d_dmd_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': ['-inline'],
- 'release': ['-inline'],
- 'minsize': [],
- 'custom': [],
- }
-
-mono_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': ['-optimize+'],
- 'release': ['-optimize+'],
- 'minsize': [],
- 'custom': [],
- }
-
-swift_buildtype_args: T.Dict[str, T.List[str]] = {'plain': [],
- 'debug': [],
- 'debugoptimized': [],
- 'release': [],
- 'minsize': [],
- 'custom': [],
- }
+cuda_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': ['-g', '-G'],
+ 'debugoptimized': ['-g', '-lineinfo'],
+ 'release': [],
+ 'minsize': [],
+ 'custom': [],
+}
+
+java_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': ['-g'],
+ 'debugoptimized': ['-g'],
+ 'release': [],
+ 'minsize': [],
+ 'custom': [],
+}
+
+rust_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': [],
+ 'release': [],
+ 'minsize': [],
+ 'custom': [],
+}
+
+d_gdc_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': ['-finline-functions'],
+ 'release': ['-finline-functions'],
+ 'minsize': [],
+ 'custom': [],
+}
+
+d_ldc_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': ['-enable-inlining', '-Hkeep-all-bodies'],
+ 'release': ['-enable-inlining', '-Hkeep-all-bodies'],
+ 'minsize': [],
+ 'custom': [],
+}
+
+d_dmd_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': ['-inline'],
+ 'release': ['-inline'],
+ 'minsize': [],
+ 'custom': [],
+}
+
+mono_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': ['-optimize+'],
+ 'release': ['-optimize+'],
+ 'minsize': [],
+ 'custom': [],
+}
+
+swift_buildtype_args: T.Dict[str, T.List[str]] = {
+ 'plain': [],
+ 'debug': [],
+ 'debugoptimized': [],
+ 'release': [],
+ 'minsize': [],
+ 'custom': [],
+}
gnu_winlibs = ['-lkernel32', '-luser32', '-lgdi32', '-lwinspool', '-lshell32',
'-lole32', '-loleaut32', '-luuid', '-lcomdlg32', '-ladvapi32']
@@ -1017,7 +1026,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
rm_exact = ('-headerpad_max_install_names',)
rm_prefixes = ('-Wl,', '-L',)
rm_next = ('-L', '-framework',)
- ret = [] # T.List[str]
+ ret: T.List[str] = []
iargs = iter(args)
for arg in iargs:
# Remove this argument