我目前正在使用Web-Assembly在MacOS for Qt上创建设置。
我遵循了这两个链接 - How to capture and print PowerShell exception message和https://wiki.qt.io/Qt_for_WebAssembly
步骤已完成 -
CMAKE安装
Python 2.7.10 setup
3.WASM ToolChain设置 -
Ex- $ emcc hello.c -s WASM=1 -o hello.html
==>最后测试了样本c程序,它运行正常。
Ex - git clone -b wip/webassembly https://code.qt.io/qt/qtbase.git
4.下载Qt for emsdk
$/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
5.还按以下两个命令成功运行(/Path/To/Qt/5.11.0/Src/qtbase) -
'Keys'
所以我的下一个要求是 - (将emscripten编译器添加到Qt Creator)
找到此链接 - http://qtandeverything.blogspot.in 和步骤4.建议“将emscripten编译器添加到Qt Creator”。
所以,我的问题是在Qt Creator中创建emscripten编译器的方法是什么。
另外,请建议我使用Webassembly跟踪Qt的确切步骤
提前致谢。
答案 0 :(得分:0)
在第5步中,您将make
放在qtbase文件夹中后,将显示一个qmake文件。要成功编译项目,您所需要做的就是从要在浏览器中运行的Qt项目文件夹中进行以下操作:
/path/to/qmake/inside/qtbase && make
这将限于qtbase支持的项目类型。 您可以引用链接Qt For WebAssembly。
答案 1 :(得分:0)
我知道这是个老问题,但是无论如何都要回答。
假设您现在使用的是5.12(测试版)或存储库
是的,有一种方法可以手动导入工具包。
工具->选项->套件
* 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版本->
* add <navigate to your qt for wasm> qmake
套件:
* add qt5-wasm
* compilers: emcc and emc++
* Qt Version: Qt for Webassembly