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?
You could try and set the
CMAKE_EXECUTABLE_SUFFIX
to.html
on the command line or theCMakeLists.txt