编译protobuf的WASM库
记录
虽然最新的插件在WASM
暂时去掉protobuf
作为通信协议,但是也准备记录一下,为WASM
编译protobuf
的操作。
临时记录 https://github.com/coding2233/docker-arch-emscripten-protobuf
v3.9.0
因为这里的版本还支持makefile
编译 编译流程https://github.com/coding2233/docker-arch-emscripten-protobuf/blob/main/.github/workflows/docker-publish.yml
主要为WASM
编译库文件的时候,需要优先应用几个patch
, 这几个patch
也是专门为当前版本实现的
latest
未尝试
最新的版本,已经改成了bazel
作为编译构建工具,需要修改对应的patch
然后再尝试编译成WASM
的库。 也可以尝试xmake f --trybuild=bazel
xmake加载protobuf
1
2
--add_files("protocol/*.cc","protocol/lib/libprotobuf.so.o")
--add_includedirs("protocol","protocol/include")
This post is licensed under CC BY 4.0 by the author.