ArthurSonzogni / ftxui-starter

A starter project using the FTXUI library
72 stars 15 forks source link

[Question] Compile and run webassembly #2

Open Guerout-Arnaud opened 2 years ago

Guerout-Arnaud commented 2 years ago

Hi, sorry to bother you. Could you please explain me how to build and run the webassembly project.

I've tried the same process as described in smk-starter (copy-pasting run_webassembly script and index.html) but this doesn't seem to work.

Thanks by advance

ArthurSonzogni commented 2 years ago

ftxui-starter currently do not show how to support WebAssembly. I should add support. Happy to merge any PR going into this direction.

In the meantime, you can probably read this thread: https://github.com/ArthurSonzogni/FTXUI/issues/369 and grab the corresponding parts in their starter repository: https://github.com/kajmaj87/ftxui_minimal ?

Note that they explained you should use:

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/yours/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DPLATFORM=Web -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 

but you can directly use:

emcmake cmake ..
Guerout-Arnaud commented 2 years ago

Thanks, i'll have a look at it and go back to you asap