Merge pull request #82790 from MarioLiebisch/warn-wasm-no-dlink

Web: Catch using GDExtensions in a non-dlink build
This commit is contained in:
Rémi Verschelde 2023-10-09 15:33:02 +02:00
commit 7c12111c1c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -164,6 +164,10 @@ const Engine = (function () {
// Preload GDExtension libraries.
const libs = [];
if (me.config.gdextensionLibs.length > 0 && !me.rtenv['loadDynamicLibrary']) {
return Promise.reject(new Error('GDExtension libraries are not supported by this engine version. '
+ 'Enable "Extensions Support" for your export preset and/or build your custom template with "dlink_enabled=yes".'));
}
me.config.gdextensionLibs.forEach(function (lib) {
libs.push(me.rtenv['loadDynamicLibrary'](lib, { 'loadAsync': true }));
});