godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.69k stars 528 forks source link

[Web] Force emcc to use "wasm" longjmp mode #1489

Closed Faless closed 3 months ago

Faless commented 3 months ago

SUPPORT_LONGJMP have changed since emscripten 3.1.32 to default to "wasm" mode when exceptions are enabled, and "emscripten" mode when disabled.

While we generally don't use exception in core, linked libraries may need them, and emscripten doesn't plan to support WASM EH + Emscripten SjLj in the long term.

See godotengine/godot#93143

dsnopek commented 2 months ago

I'm not sure if this one should really be cherry-picked? Does this option need to be matched with a Godot that's also built with this option? If so, I guess we can't cherry-pick it unless Godot cherry-picks the corresponding change.

dsnopek commented 3 weeks ago

@Faless Is this a change that should be cherry-picked?

Faless commented 3 weeks ago

@Faless Is this a change that should be cherry-picked?

Yes, I would cherry pick it.

If you are targeting 4.1 or 4.2, it won't matter since the flag is already default in emcc for pthreads builds (and 4.1/4.2 did not support single threaded builds).

But if you use an old godot-cpp to target better minimum compatibility for other platforms, you will (hopefully) be able to use it to target modern wasm builds.

dsnopek commented 3 weeks ago

Thanks!

Cherry-picked for 4.2 in PR https://github.com/godotengine/godot-cpp/pull/1570

dsnopek commented 3 weeks ago

Cherry-picked for 4.1 in PR https://github.com/godotengine/godot-cpp/pull/1572