From a594e95c9a2faef247a284983ef3ece277917d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 16 Dec 2022 17:24:48 +0100 Subject: [PATCH] wasm: support setting Emscripten configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support passing Emscripten configuration options to the QtLoader constructor using the "moduleConfig" key. Previously, it was possible to set Emscripten config options on the global Module object. However, recent versions if Qt has switched to using the MODULARIZE=1 build setting, in which case there is no global object. Fixes: QTBUG-107979 Pick-to: 6.5 Change-Id: Ie99b772ddbb1d9f5464c868a43c821bae01519e0 Reviewed-by: MikoĊ‚aj Boc Reviewed-by: Lorn Potter --- src/plugins/platforms/wasm/qtloader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wasm/qtloader.js b/src/plugins/platforms/wasm/qtloader.js index 75385e8111b..5fa5c288f39 100644 --- a/src/plugins/platforms/wasm/qtloader.js +++ b/src/plugins/platforms/wasm/qtloader.js @@ -40,6 +40,8 @@ // // Config keys // +// moduleConfig : {} +// Emscripten module configuration // containerElements : [container-element, ...] // One or more HTML elements. QtLoader will display loader elements // on these while loading the application, and replace the loader with a @@ -131,7 +133,7 @@ function _QtLoader(config) // The Emscripten module and module configuration object. The module // object is created in completeLoadEmscriptenModule(). self.module = undefined; - self.moduleConfig = {}; + self.moduleConfig = config.moduleConfig || {}; // Qt properties. These are propagated to the Emscripten module after // it has been created.