Webassembly是一种兼容Web的容器,它并不是一门新的编程语言,它更像一种新的编译器,可以帮助代码解释到二进制方向。同时它是一套完整的语义系统,你也可以像使用Docker一样使用Webassembly。从命名的角度Webassembly可以写作单词的组合,也就是:Web base simply(简单网络基础)读音一定也是这样的(确信)
root@minloha:~/WebAssembly/demo01# cd build/ root@minloha:~/WebAssembly/demo01/build# emcmake cmake .. configure: cmake .. -DCMAKE_TOOLCHAIN_FILE=/root/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/root/emsdk/node/14.18.2_64bit/bin/node;--experimental-wasm-threads -- Building project! CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.16)
should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run "cmake --help-policy CMP0000". This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done -- Generating done -- Build files have been written to: /root/WebAssembly/demo01/build root@minloha:~/WebAssembly/demo01/build# ls CMakeCache.txt CMakeFiles cmake_install.cmake Makefile src root@minloha:~/WebAssembly/demo01/build# emmake make make: make Scanning dependencies of target MinuiW [ 50%] Building CXX object src/CMakeFiles/MinuiW.dir/main.o [100%] Linking CXX executable MinuiW.js [100%] Built target MinuiW root@minloha:~/WebAssembly/demo01/build#
我们可以看到已经生成了MinuiW.js文件,我们浅浅的看一下。
1 2 3
root@minloha:~/WebAssembly/demo01/build# cd src root@minloha:~/WebAssembly/demo01/build/src# ls CMakeFiles cmake_install.cmake Makefile MinuiW.js MinuiW.wasm