diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-10-20 14:05:58 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-10-21 18:02:34 +0200 |
commit | 2c8cf8eb42749f6999cc10169c188f9df23738f5 (patch) | |
tree | 4250e84452e10050b815d9dcfb30ce5d7f344ce6 /src/corelib/Qt6WasmMacros.cmake | |
parent | e487b07e18f1cb7ff126744be57b2ae1b9839c6c (diff) |
Fix the workaround in ~QWasmOpenGLContext
The workaround stopped working because JSEvents is now not a global
object. Update the workaround by exporting the JSEvents object from
emscripten runtime and replacing the function that removes the
event handlers to a dummy function that does nothing temporarily, only
to revert it when the context is destroyed.
Fixes: QTBUG-107197
Pick-to: 6.4
Change-Id: Icceae884c85e04fdafcca6cf3c563094d3f6f0dc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/Qt6WasmMacros.cmake')
-rw-r--r-- | src/corelib/Qt6WasmMacros.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/Qt6WasmMacros.cmake b/src/corelib/Qt6WasmMacros.cmake index 6153c8d617..2276fcf6da 100644 --- a/src/corelib/Qt6WasmMacros.cmake +++ b/src/corelib/Qt6WasmMacros.cmake @@ -85,18 +85,20 @@ endfunction() function(_qt_internal_add_wasm_extra_exported_methods target) get_target_property(wasm_extra_exported_methods "${target}" QT_WASM_EXTRA_EXPORTED_METHODS) + set(wasm_default_exported_methods "UTF16ToString,stringToUTF16,JSEvents") + if(NOT wasm_extra_exported_methods) set(wasm_extra_exported_methods ${QT_WASM_EXTRA_EXPORTED_METHODS}) endif() if(wasm_extra_exported_methods) target_link_options("${target}" PRIVATE - "SHELL:-s EXPORTED_RUNTIME_METHODS=UTF16ToString,stringToUTF16,${wasm_extra_exported_methods}" + "SHELL:-s EXPORTED_RUNTIME_METHODS=${wasm_default_exported_methods},${wasm_extra_exported_methods}" ) else() # an errant dangling comma will break this target_link_options("${target}" PRIVATE - "SHELL:-s EXPORTED_RUNTIME_METHODS=UTF16ToString,stringToUTF16" + "SHELL:-s EXPORTED_RUNTIME_METHODS=${wasm_default_exported_methods}" ) endif() endfunction() |