The current build-js.sh has some issues like compiling all source files sequentially, without parallelization.
One option was #2448 which used a Makefile, but that's not windows-friendly.
We should probably use CMake as described there. In fact, we can probably just use the existing CMake we use for native builds here, just with some ifs for the emscripten target. Specifically, for emscripten we'd port only wasm-opt, and we'd include the binaryen.js JS glue etc. (wasm-opt has everything binaryen.js needs, and in fact we may want to use the wasm-opt commandline interface eventually.)
The current build-js.sh has some issues like compiling all source files sequentially, without parallelization.
One option was #2448 which used a Makefile, but that's not windows-friendly.
We should probably use CMake as described there. In fact, we can probably just use the existing CMake we use for native builds here, just with some ifs for the emscripten target. Specifically, for emscripten we'd port only wasm-opt, and we'd include the binaryen.js JS glue etc. (wasm-opt has everything binaryen.js needs, and in fact we may want to use the wasm-opt commandline interface eventually.)