summaryrefslogtreecommitdiffstats
path: root/cmake/QtWasmHelpers.cmake
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2021-10-19 16:03:21 +1000
committerLorn Potter <lorn.potter@gmail.com>2021-11-04 17:26:49 +1000
commit2148e1f0e6026ad7a87c7eec0362d1250c1f09e9 (patch)
tree74bbff8f39c87446d1524918268780063d8c9dc7 /cmake/QtWasmHelpers.cmake
parent873edc0f150977379f7b203cb8a20ad89e36fbc0 (diff)
wasm: increase default initial memory
Some apps may need more initial memory when linking, emscripten will fail with: wasm-ld: error: initial memory too small This increases the default initial memory form 16MB to 20MB. Larger apps might still get this error, in which case QT_WASM_INITIAL_MEMORY can be set. Pick-to: 6.2 Fixes: QTBUG-97457 Change-Id: Icdc56c41fb3a3852a9a83f7a3dc15820e83e1148 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'cmake/QtWasmHelpers.cmake')
-rw-r--r--cmake/QtWasmHelpers.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake
index 592db0d0db..ca6cadff93 100644
--- a/cmake/QtWasmHelpers.cmake
+++ b/cmake/QtWasmHelpers.cmake
@@ -28,8 +28,12 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
# (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size
# at build time. Further, browsers limit the maximum initial memory size to 1GB.
# QT_WASM_INITIAL_MEMORY must be a multiple of 64KB (i.e. 65536)
- if(NOT DEFINED QT_WASM_INITIAL_MEMORY AND QT_FEATURE_thread)
- set(QT_WASM_INITIAL_MEMORY "1GB")
+ if(NOT DEFINED QT_WASM_INITIAL_MEMORY)
+ if(QT_FEATURE_thread)
+ set(QT_WASM_INITIAL_MEMORY "1GB")
+ else()
+ set(QT_WASM_INITIAL_MEMORY "20MB") # emscripten default is 16MB, we need slightly more sometimes
+ endif()
endif()
if(DEFINED QT_WASM_INITIAL_MEMORY)