aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Alexeyev <akari@taisei-project.org>2019-10-15 01:10:17 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-10-18 00:31:57 +0300
commit0841d1710e40fe498ea12142a61230c8f707c7e9 (patch)
tree4f3ac82d20f6deb942c26a80c6926b1c648ec59e
parent50646a87239887fae3ad1173590709590e15c5c0 (diff)
downloadmeson-0841d1710e40fe498ea12142a61230c8f707c7e9.zip
meson-0841d1710e40fe498ea12142a61230c8f707c7e9.tar.gz
meson-0841d1710e40fe498ea12142a61230c8f707c7e9.tar.bz2
emscripten: fix false positives in linking tests
-rw-r--r--mesonbuild/compilers/mixins/emscripten.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/emscripten.py b/mesonbuild/compilers/mixins/emscripten.py
index 742d528..4797cbc 100644
--- a/mesonbuild/compilers/mixins/emscripten.py
+++ b/mesonbuild/compilers/mixins/emscripten.py
@@ -31,3 +31,16 @@ class EmscriptenMixin:
def get_linker_output_args(self, output: str) -> typing.List[str]:
return ['-o', output]
+
+ def _get_compile_output(self, dirname, mode):
+ # In pre-processor mode, the output is sent to stdout and discarded
+ if mode == 'preprocess':
+ return None
+ # Unlike sane toolchains, emcc infers the kind of output from its name.
+ # This is the only reason why this method is overriden; compiler tests
+ # do not work well with the default exe/obj suffices.
+ if mode == 'link':
+ suffix = 'js'
+ else:
+ suffix = 'wasm'
+ return os.path.join(dirname, 'output.' + suffix)