diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-12-29 17:54:29 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-06-20 09:08:03 +0200 |
commit | 1f6cac0da9c31b67f5cb5850ce52a4622e57b4d5 (patch) | |
tree | c053e1b0e4d39c2436c150eb4208ecab6023bad3 /util | |
parent | db9e206deecab7b78dd2177d4bcaf6415fb84c94 (diff) |
Make WASM export names different across modules
The export name is now ${TARGET_NAME}Entry. This can also be overridden
by using QT_WASM_EXPORT_NAME, both in CMake and qmake
Change-Id: I59c97ae6e22f0b2720716e9d7eff7b6b13d37ab5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'util')
-rw-r--r-- | util/wasm/batchedtestrunner/qwasmjsruntime.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/wasm/batchedtestrunner/qwasmjsruntime.js b/util/wasm/batchedtestrunner/qwasmjsruntime.js index b8603f2618..d973914cd3 100644 --- a/util/wasm/batchedtestrunner/qwasmjsruntime.js +++ b/util/wasm/batchedtestrunner/qwasmjsruntime.js @@ -109,18 +109,18 @@ export class CompiledModule { this.#resourceLocator = resourceLocator; } - static make(js, wasm, resourceLocator + static make(js, wasm, entryFunctionName, resourceLocator ) { const exports = {}; eval(js); - if (!exports.createQtAppInstance) { + if (!exports[entryFunctionName]) { throw new Error( - 'createQtAppInstance has not been exported by the main script' + '${entryFunctionName} has not been exported by the main script' ); } return new CompiledModule( - exports.createQtAppInstance, js, wasm, resourceLocator + exports[entryFunctionName], js, wasm, resourceLocator ); } @@ -218,6 +218,6 @@ export class ModuleLoader { ); const [js, wasm] = await Promise.all([jsLoadPromise, wasmLoadPromise]); - return CompiledModule.make(js, wasm, this.#resourceLocator); + return CompiledModule.make(js, wasm, `${moduleName}_entry`, this.#resourceLocator); } } |