Qt for WebAssembly: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Hello Qt for WebAssembly (the wiki page))
 
(Added build instructions)
Line 4: Line 4:


This Wiki page is also a work in progress, please see the development tracking bug for more information: https://bugreports.qt.io/browse/QTBUG-63917
This Wiki page is also a work in progress, please see the development tracking bug for more information: https://bugreports.qt.io/browse/QTBUG-63917
===== Getting the code =====
qtbase branch: [http://code.qt.io/cgit/qt/qtbase.git/log/?h=wip/webassembly wip/webassembly] ( git clone -b wip/webassembly https://code.qt.io/qt/qtbase.git )
qtdeclarative branch: [http://code.qt.io/cgit/qt/qtdeclarative.git/log/?h=wip/webassembly wip/webassembly] ( git clone -b wip/webassembly https://code.qt.io/qt/qtdeclarative.git )
===== Building Qt =====
Requirements: [http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html Emscripten] (known-good version: 1.37.33)
Supported host dev platforms: linux, macOS (Windows is not currently supported)
<blockquote>./configure -xplatform emscripten -confirm-license -opensource -developer-build -release -static -no-thread -nomake tests -nomake examples  -no-dbus -no-headersclean -no-feature-networkinterface  -system-libpng -no-ssl -no-warnings-are-errors</blockquote><blockquote>make module-qtbase</blockquote>
===== Building and running applications =====
<blockquote>/path/to/qmake && make</blockquote>
Start a web server (e.g. "python -m SimpleHTTPServer"), open e.g. localhost:8000/appname.html in a web browser. We test on Chrome, Firefox, and Safari (all desktop). Firefox (nightly) currently has the most performant wasm compiler, and is recommended for dev work.
You can also use:<blockquote>/path/to/emscripten/emrun --browser=firefox appname.html</blockquote><blockquote></blockquote>

Revision as of 19:12, 19 April 2018

Qt for WebAssembly makes it possible to build Qt applications as WebAssembly modules in order to target Web browsers.

Qt for WebAssembly is currently in development. A tech preview release is scheduled for release with Qt 5.11.

This Wiki page is also a work in progress, please see the development tracking bug for more information: https://bugreports.qt.io/browse/QTBUG-63917

Getting the code

qtbase branch: wip/webassembly ( git clone -b wip/webassembly https://code.qt.io/qt/qtbase.git )

qtdeclarative branch: wip/webassembly ( git clone -b wip/webassembly https://code.qt.io/qt/qtdeclarative.git )

Building Qt

Requirements: Emscripten (known-good version: 1.37.33)

Supported host dev platforms: linux, macOS (Windows is not currently supported)

./configure -xplatform emscripten -confirm-license -opensource -developer-build -release -static -no-thread -nomake tests -nomake examples  -no-dbus -no-headersclean -no-feature-networkinterface  -system-libpng -no-ssl -no-warnings-are-errors

make module-qtbase

Building and running applications

/path/to/qmake && make

Start a web server (e.g. "python -m SimpleHTTPServer"), open e.g. localhost:8000/appname.html in a web browser. We test on Chrome, Firefox, and Safari (all desktop). Firefox (nightly) currently has the most performant wasm compiler, and is recommended for dev work.

You can also use:

/path/to/emscripten/emrun --browser=firefox appname.html