summaryrefslogtreecommitdiffstats
path: root/cmake/QtWasmHelpers.cmake
Commit message (Collapse)AuthorAgeFilesLines
* wasm: don’t set exit_runtimeMorten Sørvig2021-06-231-1/+1
| | | | | | | | | | | | | | | | | | Go with Emscripten’s default of not shutting down on main() exit; this allows for writing main() in such a way that avoids the exec() workaround. Existing main() implementations (which do use the exec() workaround) do not shut down Qt cleanly anyway, so we gain little by shutting down the Emscripten runtime. Applications can set this flag if they do want to shut down on main() exit: LFAGS += -s EXIT_RUNTIME=1 Change-Id: I52e1cc2bc907d1d2146822713e39b7610db3f95b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: enable MODULARIZE option and set EXPORT_NAMEMorten Sørvig2021-06-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make Emscripten generate a global constructor function ("createQtAppInstance()") instead of a global javascript module object. This enables more fine-grained control over module instantiation; previously the module object would be created when the runtime javascript was evaluated, and the number of emscripten module/instances was limited to one per page. Set EXPORT_NAME to “createQtAppInstance” which avoids collisions with other non-Qt Emscripten modules on the same page. A further improvement would be to include the app name in EXPORT_NAME, but this is not done at this time. Update the code in qtloader.js to call the constructor function instead of working on a global module object. The qtloader.js API is functional before the wasm and Emscripten modules have been instantiated; store properties and forward to the Emscripten module when it's created. Change-Id: I12c49a5b9a4a932bbc46fcc5e5ecc453fd0fe7f0 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: fix build for emscripten 2.0.14Lorn Potter2021-06-211-1/+1
| | | | | | | | new syntax rules for EXTRA_EXPORTED_RUNTIME_METHODS valid after 2.0.16 Pick-to: 6.2 Change-Id: Iff33e4c6f3176619fb35ec0994a7cc87b5d937c7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix threaded buildsLorn Potter2021-06-081-2/+4
| | | | | | | set the thread pool size default to 4 Change-Id: I038a81610c82ac4d162c044d0e1f58196cffc7b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix cmake syntax for emscriptenLorn Potter2021-05-271-4/+4
| | | | | | | | | | | fix debugging demangler Emscripten apparently does not like the quotes in the compiler argument and remove array syntax Change-Id: I66652f6bdc5872faf540a877ca01bf75dde47bbb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* wasm: make sure bind is compiler argumentLorn Potter2021-05-141-0/+1
| | | | | | Fixes: QTBUG-93713 Change-Id: I027caccb5c37bab529c80efac0b575a363be5f89 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* wasm: add cmake build supportLorn Potter2021-04-011-0/+92
A few configure defines get changed: QMAKE_WASM_PTHREAD_POOL_SIZE is now QT_WASM_PTHREAD_POOL_SIZE QMAKE_WASM_TOTAL_MEMORY is now QT_WASM_INITIAL_MEMORY QMAKE_WASM_SOURCE_MAP_BASE is now QT_WASM_SOURCE_MAP_BASE device-option EMSCRIPTEN_ASYNCIFY=1 is QT_EMSCRIPTEN_ASYNCIFY=1 To create source maps for debugging. use device-option QT_WASM_SOURCE_MAP=1 Task-number: QTBUG-78647 Change-Id: If9f30cd7fb408c386d6d69b5f7b1beecf1ab44b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>