diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-07-17 00:29:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 00:29:37 +0300 |
commit | 0dba7340ecfbe84231a14559ef7f9e7dfb7d1299 (patch) | |
tree | ade6d93a8c93bfbfe9df8de6796c93588e3fe080 /mesonbuild/compilers/mixins/emscripten.py | |
parent | b60ea0851b1dfe4400dc2d12b127300b1da41105 (diff) | |
parent | 9b86c67e19b91eee065c1e3706ad5521801022da (diff) | |
download | meson-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.py | 11 |
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' |