Closed huxingyi closed 1 year ago
$ git clone https://github.com/emscripten-core/emsdk.git $ cd emsdk $ git pull $ ./emsdk install 3.1.25 $ ./emsdk activate 3.1.25 $ em++ --version
$ gunzip qt-everywhere-src-6.5.2.tar.xz $ tar xvf qt-everywhere-src-6.5.2.tar $ cd qt-everywhere-src-6.5.2 $ ./configure $ cmake --build . --parallel
$ mkdir qt-everywhere-src-6.5.2-webassembly $ tar xvf qt-everywhere-src-6.5.2.tar -C ./qt-everywhere-src-6.5.2-webassembly $ cd /Users/jeremy/Repositories/emsdk $ ./emsdk install 3.1.25 $ ./emsdk activate 3.1.25 $ cd /Users/jeremy/Repositories/qt-everywhere-src-6.5.2-webassembly/qt-everywhere-src-6.5.2 $ source /Users/jeremy/Repositories/emsdk/emsdk_env.sh $ ./configure -feature-thread -qt-host-path /Users/jeremy/Repositories/qt-everywhere-src-6.5.2/qtbase -platform wasm-emscripten -prefix $PWD/qtbase $ cmake --build . --parallel -t qtbase -t qtdeclarative -t qtimageformats -t qtsvg
$ cd /Users/jeremy/Repositories/dust3d/application $ source /Users/jeremy/Repositories/emsdk/emsdk_env.sh $ /Users/jeremy/Repositories/qt-everywhere-src-6.5.2-webassembly/qt-everywhere-src-6.5.2/qtbase/bin/qmake $ make -j`sysctl -n hw.logicalcpu`
SimpleHTTPServer_SharedArrayBuffer.py:
#!/usr/bin/env python3 from http.server import HTTPServer, SimpleHTTPRequestHandler, test import sys class SimpleHTTPServer_SharedArrayBuffer (SimpleHTTPRequestHandler): def end_headers (self): self.send_header('Cross-Origin-Opener-Policy', 'same-origin') self.send_header('Cross-Origin-Embedder-Policy', 'require-corp') SimpleHTTPRequestHandler.end_headers(self) if __name__ == '__main__': test(SimpleHTTPServer_SharedArrayBuffer, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
$ python3 SimpleHTTPServer_SharedArrayBuffer.py
Install emsdk:
Build Qt6 as normal host version:
Build Qt6 as WebAssembly version:
Build Dust3D WebAssembly:
Run local server on application folder:
SimpleHTTPServer_SharedArrayBuffer.py:
Notes:
TODOs: