3

I'm using emscripten to compile c++ to WASM, but can only do this for one file at a time. I don't want to put my entire project and libraries in one file, but I haven't found any information on how to properly compile it.

1
  • Research build systems. Read up on linking multiple object files / compilation units into one library or executable. Commented Oct 20, 2017 at 20:16

1 Answer 1

6

Just put all source files in the emcc command line like this:

emcc src1.cpp src2.cpp src3.cpp

See reference here: https://kripken.github.io/emscripten-site/docs/tools_reference/emcc.html

Sign up to request clarification or add additional context in comments.

1 Comment

How would you go about doing it if they are already separate SIDE_MODULE wasm files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.