Skip to content

Commit

Permalink
chore(developer): enable build for emscripten 3.1.60+
Browse files Browse the repository at this point in the history
Emscripten 3.1.60 made a breaking change to `BindingType::toWireType`
(why is this done in a patch version?) so this change ensures that we
can continue to build on 3.1.58 and 3.1.64 (which is needed for #12234),
as a bridging strategy. We will need to merge this into 17.0-stable as
well so that we can upgrade the build agents to 3.1.64.

Relates-to: emscripten-core/emscripten#21692
Relates-to: #12234
  • Loading branch information
mcdurdin committed Aug 21, 2024
1 parent f6c2187 commit a0ebe13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions developer/src/kmcmplib/src/CompilerInterfacesWasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ struct BindingType<std::vector<T, Allocator>> {
using ValBinding = BindingType<val>;
using WireType = ValBinding::WireType;

#if __EMSCRIPTEN_major__ == 3 && __EMSCRIPTEN_minor__ == 1 && __EMSCRIPTEN_tiny__ >= 60
// emscripten-core/emscripten#21692
static WireType toWireType(const std::vector<T, Allocator> &vec, rvp::default_tag) {
return ValBinding::toWireType(val::array(vec), rvp::default_tag{});
}
#else
static WireType toWireType(const std::vector<T, Allocator> &vec) {
return ValBinding::toWireType(val::array(vec));
}
#endif

static std::vector<T, Allocator> fromWireType(WireType value) {
return vecFromJSArray<T>(ValBinding::fromWireType(value));
Expand Down

0 comments on commit a0ebe13

Please sign in to comment.