42 lines
5.7 KiB
Plaintext
42 lines
5.7 KiB
Plaintext
https://doc.qt.io/qt-5/wasm.html
|
|
https://github.com/emscripten-core/emsdk
|
|
https://emscripten.org/docs/getting_started/downloads.html
|
|
|
|
https://blog.csdn.net/a137748099/article/details/117157623
|
|
1.39.8
|
|
emsdk install 1.39.8
|
|
emsdk activate --embedded 1.39.8
|
|
安装完成后配置文件路径
|
|
D:/wyc/library/wasm/emsdk-1.39.8/.emscripten
|
|
配置文件内容
|
|
import os
|
|
emsdk_path=os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\', '/')
|
|
NODE_JS = '' + emsdk_path + '/node/12.9.1_64bit/bin/node.exe'
|
|
PYTHON = '' + emsdk_path + '/python/3.7.4_64bit/python.exe'
|
|
JAVA = '' + emsdk_path + '/java/8.152_64bit/bin/java.exe'
|
|
LLVM_ROOT = '' + emsdk_path + '/upstream/bin'
|
|
BINARYEN_ROOT = '' + emsdk_path + '/upstream'
|
|
EMSCRIPTEN_ROOT = '' + emsdk_path + '/upstream/emscripten'
|
|
TEMP_DIR = '' + emsdk_path + '/tmp'
|
|
COMPILER_ENGINE = NODE_JS
|
|
JS_ENGINES = [NODE_JS]
|
|
|
|
|
|
|
|
将 C 和 C++ 代码编译为 WebAssembly (WASM) 或 asm.js
|
|
|
|
WebAssembly (WASM):
|
|
一种紧凑的二进制格式,用于在 Web 上运行高性能的代码。它是现代浏览器原生支持的底层字节码格式,旨在作为 JavaScript 的高性能替代方案。
|
|
|
|
asm.js:
|
|
一个高度优化的 JavaScript 子集,主要用于让 JavaScript 在浏览器中接近原生性能运行。它是 WebAssembly 的先驱技术,
|
|
通过标准的 JavaScript 引擎运行。
|
|
|
|
|
|
|
|
|
|
|
|
https://blog.evernightfireworks.com/emscripten_config/
|
|
|
|
|
|
import os emsdk_path=os.path.dirname(os.environ.get('EM_CONFIG')).replace('\\', '/') NODE_JS = '' + emsdk_path + '/node/12.9.1_64bit/bin/node.exe' PYTHON = '' + emsdk_path + '/python/3.7.4_64bit/python.exe' JAVA = '' + emsdk_path + '/java/8.152_64bit/bin/java.exe' LLVM_ROOT = '' + emsdk_path + '/upstream/bin' BINARYEN_ROOT = '' + emsdk_path + '/upstream' EMSCRIPTEN_ROOT = '' + emsdk_path + '/upstream/emscripten' TEMP_DIR = '' + emsdk_path + '/tmp' COMPILER_ENGINE = NODE_JS JS_ENGINES = [NODE_JS] Adding directories to PATH: PATH += D:\wyc\library\wasm\emsdk-1.39.8 PATH += D:\wyc\library\wasm\emsdk-1.39.8\node\12.9.1_64bit\bin PATH += D:\wyc\library\wasm\emsdk-1.39.8\java\8.152_64bit\bin PATH += D:\wyc\library\wasm\emsdk-1.39.8\upstream\emscripten Setting environment variables: EMSDK = D:/wyc/library/wasm/emsdk-1.39.8 EM_CONFIG = D:\wyc\library\wasm\emsdk-1.39.8\.emscripten EM_CACHE = D:/wyc/library/wasm/emsdk-1.39.8/.emscripten_cache EMSDK_NODE = D:\wyc\library\wasm\emsdk-1.39.8\node\12.9.1_64bit\bin\node.exe EMSDK_PYTHON = D:\wyc\library\wasm\emsdk-1.39.8\python\3.7.4_64bit\python.exe JAVA_HOME = D:\wyc\library\wasm\emsdk-1.39.8\java\8.152_64bit Set the following tools as active: node-12.9.1-64bit python-3.7.4-64bit java-8.152-64bit releases-upstream-9e60f34accb4627d7358223862a7e74291886ab6-64bit The changes made to environment variables only apply to the currently running shell instance. Use the 'emsdk_env.bat' to re-enter this environment later, or if you'd like to permanently register this environment globally to all users in Windows Registry, rerun this command with the option --global. |