Web: Catch using GDExtensions in a non-dlink build

Previously this would simply fail with a cryptic
`me.rtenv.loadDynamicLibrary is not a function` error.
This commit is contained in:
Mario Liebisch 2023-10-04 16:28:13 +02:00
parent 6916349697
commit 56a3cdc2f0
No known key found for this signature in database
GPG Key ID: 32B56AC1F87EFBF9
1 changed files with 4 additions and 0 deletions

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 }));
});