aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/emscripten.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/emscripten.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/emscripten.py')
-rw-r--r--mesonbuild/compilers/mixins/emscripten.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py
index 22b7655..fef22b9 100644
--- a/mesonbuild/compilers/mixins/emscripten.py
+++ b/mesonbuild/compilers/mixins/emscripten.py
@@ -22,6 +22,7 @@ from ... import coredata
from ... import mesonlib
from ...mesonlib import OptionKey
from ...mesonlib import LibType
+from mesonbuild.compilers.compilers import CompileCheckMode
if T.TYPE_CHECKING:
from ...environment import Environment
@@ -36,7 +37,7 @@ else:
def wrap_js_includes(args: T.List[str]) -> T.List[str]:
- final_args = []
+ final_args: T.List[str] = []
for i in args:
if i.endswith('.js') and not i.startswith('-'):
final_args += ['--js-library', i]
@@ -46,14 +47,12 @@ def wrap_js_includes(args: T.List[str]) -> T.List[str]:
class EmscriptenMixin(Compiler):
- def _get_compile_output(self, dirname: str, mode: str) -> str:
- # In pre-processor mode, the output is sent to stdout and discarded
- if mode == 'preprocess':
- return None
+ def _get_compile_output(self, dirname: str, mode: CompileCheckMode) -> str:
+ assert mode != CompileCheckMode.PREPROCESS, 'In pre-processor mode, the output is sent to stdout and discarded'
# Unlike sane toolchains, emcc infers the kind of output from its name.
# This is the only reason why this method is overridden; compiler tests
# do not work well with the default exe/obj suffices.
- if mode == 'link':
+ if mode == CompileCheckMode.LINK:
suffix = 'js'
else:
suffix = 'o'