aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/mixins/emscripten.py
diff options
context:
space:
mode:
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'