Commit 2dbcd52
committed
fix(web): make the Emscripten build produce a module the browser will accept
Two independent blockers, both found running the web build against a current emsdk (5.0.7)
after the Game-lifetime crash in 16c3b67 was fixed:
- sol2 v3.3.0 does not compile. optional<T&>::emplace calls this->construct(), which that
specialization does not have; because optional<T&> is a full specialization the lookup is
not deferred, so a newer clang diagnoses it even though nothing instantiates it, and
LuaScriptRunner.cpp fails. v3.3.1 still has it; v3.5.0 replaced the body with a placement-new
that returns properly, so the pin moves there.
- The linked module was rejected by the browser at instantiation:
"module uses a mix of legacy and new exception handling instructions". CNA selects the
standardized try_table exception ABI (-sWASM_LEGACY_EXCEPTIONS=0) in its own root
CMakeLists, while this project passed only -fwasm-exceptions -- so everything under CNA_dep
used one ABI and MeshCraft's own objects, lua54, imgui, manifold and tinygltf used the
other. Matching CNA's flag puts every object in the link on the same ABI.
Verified end to end in headless Chrome: the editor now loads and renders -- menu bar, toolbar,
hierarchy panel, viewport grid, Properties panel, "0 objects" status -- with "[MeshCraft] New
scene" in the output and not a single exception in the console, where the same page previously
died immediately after that line.1 parent 16c3b67 commit 2dbcd52
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
415 | 421 | | |
416 | 422 | | |
417 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
418 | 429 | | |
419 | 430 | | |
420 | | - | |
| 431 | + | |
421 | 432 | | |
422 | 433 | | |
423 | 434 | | |
| |||
0 commit comments