godex icon indicating copy to clipboard operation
godex copied to clipboard

Compiling with javascript (emscripten/clang) fails

Open Beliar83 opened this issue 4 years ago • 1 comments

When I try to compile with "platform=javascript", which uses emscripten, the compilations fails with multiple errors.

The complete log can be found here, but the main problems are errors similar to the one at Line 417:

/home/karsten/git/godex/modules/bullet_physics/systems_base.cpp:22:12: error: type 'QueryResultTuple<EntityID, Any<Changed<BtRigidBody>, Changed<const BtSpaceMarker> > >' decomposes into 2 elements, but 3 names were provided for (auto [entity, body, space_marker] : p_query) {

Beliar83 avatar Jan 31 '22 13:01 Beliar83

It seems to work with the "-frelaxed-template-template-args" flag (https://clang.llvm.org/cxx_status.html#p0522)

But I have found out, that Godot 4 may not have HTML5 enabled for the time being. For now it compiles with that flag and does not crash. So just have to find what is the best place to set the flag.

I added env.Append(CXXFLAGS=["-frelaxed-template-template-args"]) to the main SConstruct of Godot, but not sure if that is the best place. At least it should only be added for clang builds, of course.

Beliar83 avatar May 06 '22 13:05 Beliar83