summaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/toolchain.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-08-10 21:19:29 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-08-11 13:41:03 -0400
commit90ce0841441506e3f409ab59ded1df8f2e6e7363 (patch)
tree3478769eef2620e9d7b5a41b73dd94c75b003465 /mesonbuild/cmake/toolchain.py
parentde1cc0b02bcb1bab6977f0ab8bb3fef0cd0646dd (diff)
downloadmeson-90ce0841441506e3f409ab59ded1df8f2e6e7363.tar.gz
treewide: automatic rewriting of all comment-style type annotations
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
Diffstat (limited to 'mesonbuild/cmake/toolchain.py')
-rw-r--r--mesonbuild/cmake/toolchain.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py
index 477629e81..be5bd66fd 100644
--- a/mesonbuild/cmake/toolchain.py
+++ b/mesonbuild/cmake/toolchain.py
@@ -144,7 +144,7 @@ class CMakeToolchain:
return res
def get_defaults(self) -> T.Dict[str, T.List[str]]:
- defaults = {} # type: T.Dict[str, T.List[str]]
+ defaults: T.Dict[str, T.List[str]] = {}
# Do nothing if the user does not want automatic defaults
if not self.properties.get_cmake_defaults():
@@ -153,13 +153,13 @@ class CMakeToolchain:
# Best effort to map the meson system name to CMAKE_SYSTEM_NAME, which
# is not trivial since CMake lacks a list of all supported
# CMAKE_SYSTEM_NAME values.
- SYSTEM_MAP = {
+ SYSTEM_MAP: T.Dict[str, str] = {
'android': 'Android',
'linux': 'Linux',
'windows': 'Windows',
'freebsd': 'FreeBSD',
'darwin': 'Darwin',
- } # type: T.Dict[str, str]
+ }
# Only set these in a cross build. Otherwise CMake will trip up in native
# builds and thing they are cross (which causes TRY_RUN() to break)