简体   繁体   English

Qt与WebAssembly设置问题

[英]Qt with WebAssembly setup issue

I am currently creating setup on MacOS for Qt with Web-Assembly. 我目前正在使用Web-Assembly在MacOS for Qt上创建设置。

I followed these two links - https://wiki.qt.io/Qt_for_WebAssembly and http://qtandeverything.blogspot.in 我按照这两个链接 - https://wiki.qt.io/Qt_for_WebAssemblyhttp://qtandeverything.blogspot.in

Steps Completed - 步骤已完成 -

  1. CMAKE installation CMAKE安装

  2. Python 2.7.10 setup Python 2.7.10设置

3.WASM ToolChain setup- 3.WASM ToolChain设置 -

$ 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. ==>最后测试了样本c程序,它运行正常。

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

4.Downloaded Qt for emsdk 4.下载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) - 5.还成功运行以下两个命令(/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) 所以我的下一个要求是 - (将emscripten编译器添加到Qt Creator)

Found this link - http://qtandeverything.blogspot.in and step 4. suggests that to "Add emscripten compiler to Qt Creator". 找到此链接 - http://qtandeverything.blogspot.in和步骤4.建议“将emscripten编译器添加到Qt Creator”。

So,My question is what is the way to create emscripten compiler in Qt Creator.? 那么,我的问题是在Qt Creator中创建emscripten编译器的方法是什么?

Also please suggest me exact step to follow Qt with Webassembly 另请建议我使用Webassembly跟踪Qt的确切步骤

Thanks In Advance. 提前致谢。

After your step 5 where you make inside of your qtbase folder, a qmake file will appear. 你的第5步,你之后make你的qtbase文件夹内,一个qmake的文件将显示。 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: 要在浏览器中运行的任何Qt项目文件夹中,您需要做的就是成功编译项目:

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

This will be limited to the project types that qtbase supports. 这将仅限于qtbase支持的项目类型。 You can refer link Qt For WebAssembly . 您可以参考链接Qt For WebAssembly

I know this is old question, but answering anyway. 我知道这是一个老问题,但无论如何要回答。

Assuming you are now using 5.12 (beta) or repo 假设您现在使用5.12(测试版)或回购

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-> Qt版本 - >

* add <navigate to your qt for wasm> qmake

Kits: 套件:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM