summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/wasm
Commit message (Collapse)AuthorAgeFilesLines
* wasm: don’t pass thread linker opts to compilerMorten Johan Sørvig2022-01-171-2/+3
| | | | | | | | | | | | Emscripten now warns against passing e.g. “ALLOW_MEMORY_GROWTH” as a compile option. Add EMCC_THREAD_CFLAGS, which gets compiler flags only. Pick-to: 6.3 Change-Id: Ifcf40c45ca75cfdfc98a12e6b9d47f34158b3407 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: modernize pthreads optionMorten Johan Sørvig2022-01-171-1/+1
| | | | | | | | | | | Use “-pthreads” instead of “-s USE_PTHREADS=1”. This is both a compile and linker option. Pick-to: 6.3 Change-Id: Iaf7cb4ec41577fe596c3e81fda05c03fe0074c08 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: remove deprecated argument for source mapsLorn Potter2021-12-131-6/+1
| | | | | | | | | -g4 was deprecated in Emscripten 2.0.17, and since we are well past that version we can safely use -gsource-map instead. Change-Id: I497155619d6320661f6be0e220b52fa7d6ca0b8e Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: update recommended emscripten to 3.0.0Lorn Potter2021-12-091-1/+1
| | | | | | | [ChangeLog][wasm] Recommended emscripten version is now 3.0.0 Change-Id: I9ae082509415d8f00b8e9970b730ad4a472da310 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: add sse2 compiler flags againMorten Johan Sørvig2021-11-021-0/+8
| | | | | | | Now with QT_FOR_CONFIG += core-private. Change-Id: Iadc61e21db6566f20c32595ef1ab83f37bc5c651 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* wasm: remove sse2 config blockMorten Johan Sørvig2021-10-271-7/+0
| | | | | | | | | | | | | | This breaks the build for qmake-based applications, with the error Project ERROR: Could not find feature sse2. Remove the offending section to make applications build again. Pick-to: 6.2 Change-Id: I0b22faa1d8d62e208d79879b822e21637bb03a3e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* wasm: add simd supportLorn Potter2021-10-051-0/+8
| | | | | | | | | | | | | | | | | | Emscripten only supports SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction sets at this time. https://emscripten.org/docs/porting/simd.html Browsers might need to enable simd support in the advanced configurations about: config or chrome:flags Enable by configuring Qt with -sse2 Pick-to: 6.2 Fixes: QTBUG-63924 Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WASM: Don’t set “-g4” by default for qmake buildsMorten Sørvig2021-04-271-6/+18
| | | | | | | | | This increases link time significantly; instead set "-g4" or the new "-gsource-map" only if source maps are enabled. Change-Id: Ibe2d438d48e9ae2fce5f79d4e8a9f17c01cf2485 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: add cmake build supportLorn Potter2021-04-011-12/+12
| | | | | | | | | | | | | | | | 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>
* wasm: Boost emscripten 1.39.8 as recommendedLorn Potter2020-03-231-1/+1
| | | | | | | [ChangeLog][WebAssembly] Updated emscripten to version 1.39.8 Change-Id: I8d19f851eb0c0dd912792cee0db69e61cf4fd5f6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-02-181-1/+3
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlinkedlist.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
| * wasm: remove dependency on perl to find emscripten versionLorn Potter2020-02-171-1/+3
| | | | | | | | | | | | Change-Id: I0d5224d497b2b5652d1be036f2a90c6c53f0c9df Fixes: QTBUG-81722 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | wasm: fix loading of default_pre.prfLorn Potter2020-02-151-1/+1
|/ | | | | | | | This fixes windows build and detection of c++ version Task-number: QTBUG-80610 Change-Id: I5196e83f9aad6663aea47c31ae4a2da4c4d74e94 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* wasm: do not use clamp mode for upstream LLVMLorn Potter2019-12-162-24/+24
| | | | | | | | | | Emscripten version 1.39.0 and above are based upon upstream LLVM, which does not contain BINARYEN_TRAP_MODE Fixes: QTBUG-80691 Change-Id: I6129f84a31a607c202e13847b50705ef1c809630 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: enforce emscripten versionLorn Potter2019-12-112-0/+30
| | | | | | | | | | | | This creates a define in the binary, as well as writing emscripten version for qmake. It also enforces app builder to use a certain known version. Task-number: QTBUG-77745 Change-Id: I37691512171635cec66aa3ffa16258081f3f1e1b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* WebAssembly: Do not use sed directly for wasm_shell.html deploymentJoerg Bornemann2019-12-091-1/+1
| | | | | | | | | Use $$QMAKE_STREAM_EDITOR, instead, which will on Windows expand to "qmake -install sed" (triggering qmake's own sed implementation) and otherwise expand to "sed". Change-Id: I57da5fb3a4f6e5a09ae25c947caa0a10d279b480 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* wasm: allow setting total memory for non thread buildsLorn Potter2019-08-221-10/+14
| | | | | | | | Using WASM_OBJECT_FILES does not allow memory growth, so we need to just explicitly check for QMAKE_WASM_TOTAL_MEMORY Change-Id: I447113972dfc3df4ee4073e8cc25481646d1507b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WASM: Make wasm_shell.html compatible with CMake configure_fileFredrik Orderud2019-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The CMake configure_file command is commonly used copy & modify template files during the build process. One limitation, thought, is that configure_file expect the variables to be replaced to be encoded using either a @APPNAME@ or ${APPNAME} convention. This commit therefore changes "APPNAME" to "@APPNAME@" in wasm_shell.html to make the HTML template file compatible with CMake configure_file. With this commit, it becomes possible to write the following CMake function that mimics what QMake is already doing: function(copy_html_js_launch_files target) set(APPNAME ${target}) configure_file("${_qt5Core_install_prefix}/plugins/platforms/wasm_shell.html" "${target}.html") configure_file("${_qt5Core_install_prefix}/plugins/platforms/qtloader.js" qtloader.js COPYONLY) endfunction() Change-Id: Ic38abdc498ba03b8d21f1b9b70aa1d480ae7f362 Reference: https://cmake.org/cmake/help/latest/command/configure_file.html Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Wasm: enable thread supportMorten Johan Sørvig2019-02-071-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | configure.json: Make the “thread” feature be allowed for wasm but disabled by default. Change qmake.conf and wasm.prf to enable Emscripten pthreads mode: - Add USE_PTHREADS=1 linker flag - Add PTHREAD_POOL_SIZE linker flag with a default pool size (4). - Add TOTAL_MEMORY linker flag to set available memory (1GB) It is possible to override options such as PTHREAD_POOL_SIZE from the application .pro file using QMAKE_WASM_PTHREAD_POOL_SIZE To change TOTAL_MEMORY, use QMAKE_WASM_TOTAL_MEMORY Make qtloader.js work in pthreads mode: - The Module.instantiateWasm callback must provide the module in addition to the instance to Emscripten. - Set Module.mainScriptUrlOrBlob so that the pthreads web workers can access the main script Task-number: QTBUG-64625 Change-Id: I1ab5a559ec97c27c5fc24500ba5f863bcd275141 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Wasm: enable source map support for debug buildsMorten Johan Sørvig2019-02-071-0/+7
| | | | | | | | | | The source map location can be configured by setting QMAKE_WASM_SOURCE_MAP_BASE in the .pro file. Fall back to “http://localhost:8000” if not set. Task-number: QTBUG-72002 Change-Id: I9da80dacdefc272f267e5db4caac274d93ba4479 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* WebAssembly: Fix compilation of application on Windows hostEskil Abrahamsen Blomfeldt2018-12-031-2/+2
| | | | | | | | | | | When running configure on a Windows host, it would fail with the error that the copy statement was invalid, due to the forward slashes. This makes configure finish without errors. Task-number: QTBUG-72000 Change-Id: Id315d7436bbbfd2cd5c5f2dfcfe0c3dc3b9e34c2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix qpa plugin build system integrationOswald Buddenhagen2018-11-211-12/+0
| | | | | | | | | | | fix the plugin name (it was missing the leading 'q') and the name used in configure (the latter making it unnecessary to mess with it in the mkspec). the qt.prf override which forced linkage of the plugin is also removed due to being completely redundant. Change-Id: I94687a34a295c36754e36a298af902b656ba2ecc Reviewed-by: Kyle Edwards <kyle.edwards@kitware.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-302-0/+93
This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>