Emscripten: Multiple files generated by add_executable
This follows the discussion https://discourse.cmake.org/t/toolchains-multiple-files-generated-by-add-executable/1161
When compiling using emscripten with its toolchain file (Emscripten.cmake), CMake does not know that it might generate multiple files when using add_executable
.
This is because CMake does not have the concept of multiple output files for a same binary target.
By default, emscripten will generate 2 files (js+wasm), but it could as well generate 3 (html+js+wasm).
The impact I know of, caused by the .wasm file not being known by cmake are:
- The file won’t be removed when using the clean target
- The file won’t be copied when using install(TARGETS )