4

I have a CMake Project that I want to compile to Web assembly. To do so I used the following commands from the base folder of the project:

mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=/home/ubuntu/emsdk/emscripten/1.38.6/cmake/Modules/Platform/Emscripten.cmake -G "Unix Makefiles"

This successfully (or at least I think) generates a .wasm file and a .js file as well as the various cmake and make files .

I also want it to generate an html file, like you can with emcc (ie. emcc example.c -s WASM=1 -o output.html).

Is it possible to do this?

1 Answer 1

12

You could try and set the CMAKE_EXECUTABLE_SUFFIX to .html on the command line or the CMakeLists.txt

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

1 Comment

This seems to be used by emscripten tests: github.com/kripken/emscripten/blob/master/tests/cmake/…

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.