From fc3b8eed2b9fb2aa7e55ac833ea08cf7eae46a0a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 11 Apr 2019 15:57:05 -0700 Subject: wasm2js: emscripten glue option (#2000) Add a wasm2js option for the glue to be in emscripten-compatible format (as opposed to ES6). This does a few things so far: * Emit START_FUNCTIONS, END_FUNCTIONS markers in the code, for future use in the optimizer. * Emit the glue as a function to be called from emscripten. --- src/tools/wasm2js.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tools') diff --git a/src/tools/wasm2js.cpp b/src/tools/wasm2js.cpp index 76a724f86..8704dbf49 100644 --- a/src/tools/wasm2js.cpp +++ b/src/tools/wasm2js.cpp @@ -370,6 +370,11 @@ int main(int argc, const char *argv[]) { [&](Options* o, const std::string& argument) { flags.pedantic = true; }) + .add("--emscripten", "", "Emulate the glue in emscripten-compatible form (and not ES6 module form)", + Options::Arguments::Zero, + [&](Options* o, const std::string& argument) { + flags.emscripten = true; + }) .add_positional("INFILE", Options::Arguments::One, [](Options *o, const std::string& argument) { o->extra["infile"] = argument; -- cgit v1.2.3