Open mmarczell-graphisoft opened 2 years ago
The changes was originally made here: https://github.com/emscripten-core/emscripten/pull/15590. I don't see any immediate reason why it should be in Emscripten.cmake instead.
I guess we want to avoid duplication we would need to find a way to set NODE_JS_EXECUTABLE
from emcmake.py
rather than CMAKE_CROSSCOMPILING_EMULATOR
.
Feel free to propose a change
For posterity, an easy workaround is to put this in your CMakeLists.txt:
if (DEFINED NODE_JS_EXECUTABLE)
set(CMAKE_CROSSCOMPILING_EMULATOR "${NODE_JS_EXECUTABLE};--experimental-wasm-threads")
endif()
Now CMAKE_CROSSCOMPILING_EMULATOR
seems to be defined in both emcmake.py and the toolchain file? Is this necessary?
Why is the
--experimental-wasm-threads
argument only set in emcmake and not in Emscripten.cmake?https://github.com/emscripten-core/emscripten/blob/7df40381247896886e918b5e7086ec7fe6df3e5b/emcmake.py#L41 vs https://github.com/emscripten-core/emscripten/blob/7df40381247896886e918b5e7086ec7fe6df3e5b/cmake/Modules/Platform/Emscripten.cmake#L411
If it was set in the latter, it would make using emcmake and using just the toolchain file more equivalent. One usecase for this is VSCode based development, where the editor's CMake plugin runs the CMake 'configure' step automatically whenever CMake files change. A so called "kit" file (link) can specify a toolchain file, but not a wrapper executable.