Kiran Prusty
Kiran Prusty

Reputation: 57

Qt with WebAssembly setup issue

I am currently creating setup on MacOS for Qt with Web-Assembly.

I followed these two links - https://wiki.qt.io/Qt_for_WebAssembly and http://qtandeverything.blogspot.in

Steps Completed -

  1. CMAKE installation

  2. Python 2.7.10 setup

3.WASM ToolChain setup-

$ git clone https://github.com/juj/emsdk.git

$ cd emsdk

$ ./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit

$ ./emsdk activate --build=Release sdk-incoming-64bit binaryen-master-  64bit

$ source ./emsdk_env.sh --build=Release

==> And finally tested sample c program, it works fine.

 Ex- $ emcc hello.c -s WASM=1 -o hello.html

4.Downloaded Qt for emsdk

 Ex - git clone -b wip/webassembly https://code.qt.io/qt/qtbase.git

5.Also successfully run following two commands (/Path/To/Qt/5.11.0/Src/qtbase) -

$/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

So my next requirement is to- (Add emscripten compiler to Qt Creator)

Found this link - http://qtandeverything.blogspot.in and step 4. suggests that to "Add emscripten compiler to Qt Creator".

So,My question is what is the way to create emscripten compiler in Qt Creator.?

Also please suggest me exact step to follow Qt with Webassembly

Thanks In Advance.

Upvotes: 3

Views: 2402

Answers (2)

Lorn Potter
Lorn Potter

Reputation: 46

I know this is old question, but answering anyway.

Assuming you are now using 5.12 (beta) or repo

Yes there is a way to manually import the kit.

Tools->Options->Kits

* add Custom c++: name: emcc++ <path/to/emscripten>/emcc++
 - x86-linux-u generic-elf-64bit
 - mkspecs: wasm-emscripten

* add custom c: name: emcc <path/to/emscripten>/emcc

Qt Versions->

* add <navigate to your qt for wasm> qmake

Kits:

* add qt5-wasm
* compilers: emcc and emc++ 
* Qt Version: Qt for Webassembly 

Upvotes: 0

Bret Hogg
Bret Hogg

Reputation: 34

After your step 5 where you make inside of your qtbase folder, a qmake file will appear. All you have to do to successfully compile a project is the following from inside of whichever Qt project folder you want to run in the browser:

/path/to/qmake/inside/qtbase && make

This will be limited to the project types that qtbase supports. You can refer link Qt For WebAssembly.

Upvotes: 2

Related Questions