From 4afd0c5456bf4792ea12e3f70223faf42f3c7801 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Fri, 15 Jul 2022 12:00:45 -0700 Subject: [PATCH] Upgrade to emscripten 3.1.15 and remove workaround. Starting with 3.1.14, embind started to support for `noexcept` which caused multiple definition errors since we have a workaround in place that alreadys supplies template instantiations for `noexcept`. This change should not affect G3 since our JS bindings are not used in G3. The upstream fix is here: https://github.com/emscripten-core/emscripten/pull/17140 Fixes #5789. --- BUILDING.md | 2 +- RELEASE_NOTES.md | 2 ++ build/web/ci-common.sh | 2 +- web/filament-js/jsbindings.cpp | 47 ---------------------------------- 4 files changed, 4 insertions(+), 49 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index fb73b5cddc..47e1e21fda 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -352,7 +352,7 @@ same version that our continuous builds use. ``` cd -curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.9.zip > emsdk.zip +curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk python ./emsdk.py install latest python ./emsdk.py activate latest diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2d35da84da..2f5dbbf64e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -5,6 +5,8 @@ A new header is inserted each time a *tag* is created. ## main branch +- WebGL: upgraded the JS bindings to work with emsdk 3.1.15 + ## v1.25.4 - backend: streamline texture upload APIs [⚠️ **API Change**] diff --git a/build/web/ci-common.sh b/build/web/ci-common.sh index 00e342a891..f2f1a9cb1d 100755 --- a/build/web/ci-common.sh +++ b/build/web/ci-common.sh @@ -17,7 +17,7 @@ export PATH="$PWD:$PATH" # npm install -g typescript # Install emscripten. -curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.9.zip > emsdk.zip +curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk ./emsdk install latest ./emsdk activate latest diff --git a/web/filament-js/jsbindings.cpp b/web/filament-js/jsbindings.cpp index ce7263d892..a9d9ac9ab9 100644 --- a/web/filament-js/jsbindings.cpp +++ b/web/filament-js/jsbindings.cpp @@ -145,53 +145,6 @@ namespace emscripten { BIND(utils::EntityManager) BIND(VertexBuffer) BIND(View) - - // embind is missing a template definition for "noexcept" methods, so - // we're supplying it ourselves while waiting for the upstream fix. - template - struct RegisterClassMethod { - - template - static void invoke(const char* methodName, - ReturnType (ClassType::*memberFunction)(Args...) noexcept) { - auto invoker = &MethodInvoker::invoke; - - typename WithPolicies::template ArgTypeList, Args...> args; - _embind_register_class_function( - TypeID::get(), - methodName, - args.getCount(), - args.getTypes(), - getSignature(invoker), - reinterpret_cast(invoker), - getContext(memberFunction), - isPureVirtual::value); - } - }; - - // embind is missing a template definition for "const noexcept" methods, so - // we're supplying it ourselves while waiting for the upstream fix. - template - struct RegisterClassMethod { - - template - static void invoke(const char* methodName, - ReturnType (ClassType::*memberFunction)(Args...) const noexcept) { - auto invoker = &MethodInvoker::invoke; - - typename WithPolicies::template ArgTypeList, Args...> args; - _embind_register_class_function( - TypeID::get(), - methodName, - args.getCount(), - args.getTypes(), - getSignature(invoker), - reinterpret_cast(invoker), - getContext(memberFunction), - isPureVirtual::value); - } - }; - } } #undef BIND