-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请教wasm的编译问题。 #24
Comments
--emit-tsd 自动生成的,参照这个文档:https://emscripten.org/docs/tools_reference/emcc.html#emcc-emit-tsd |
那emscripten不是要注册绑定吗,类似下面这种,这个你是纯手写的吗?我就想问这个注册绑定的东西是自己写的还是有工具可以自动生成。 EMSCRIPTEN_BINDINGS(Module) {
emscripten::class_<TopoDS_Shape>("TopoDS_Shape")
.constructor<>()
.function("IsNull", &TopoDS_Shape::IsNull)
.function("Nullify", &TopoDS_Shape::Nullify)
.function("Location", emscripten::select_overload<const TopLoc_Location& () const>(&TopoDS_Shape::Location))
//.function("SetLocation", emscripten::select_overload<void(const TopLoc_Location&)>(&TopoDS_Shape::Location))
.function("Located", &TopoDS_Shape::Located)
.function("Orientation", emscripten::select_overload<TopAbs_Orientation () const>(&TopoDS_Shape::Orientation))
.function("SetOrientation", emscripten::select_overload<void(TopAbs_Orientation)>(&TopoDS_Shape::Orientation))
.function("Oriented", &TopoDS_Shape::Oriented)
.function("ShapeType", &TopoDS_Shape::ShapeType)
.function("Free", emscripten::select_overload<Standard_Boolean () const>(&TopoDS_Shape::Free))
.........
.function("EmptyCopied", &TopoDS_Shape::EmptyCopied);
} |
如果要用包装好的话,可以用 opencascade.js 这个库,这个是用 python 写的自动绑定。不怕麻烦的话就手动绑定,可控性更强,只绑定你需要的接口就行。 |
还想再问下里面的chili_occ.d.ts是自动生成的吗,还是手动写的?自动生成是直接编译加选项吗? |
旧版本的chili_occ.d.ts是用的opencascade.js这个库的自定义模块自动生成,源码可以查看https://github.com/donalffons/opencascade.js/blob/master/src/buildFromYaml.py 新版本为chili-wasm是通过--emit-tsd选项自动生成。 |
1 similar comment
旧版本的chili_occ.d.ts是用的opencascade.js这个库的自定义模块自动生成,源码可以查看https://github.com/donalffons/opencascade.js/blob/master/src/buildFromYaml.py 新版本为chili-wasm是通过--emit-tsd选项自动生成。 |
好的,谢谢,能在请教一下,Handle(TDocStd_Document)这样的在cpp里面绑定要怎么写啊? |
就是一个普通的类Handle_TDocStd_Document |
想问下大佬工程里面的chili_occ.d.ts是自己写的还是编译chili_occ.wasm的时候自动生成,如果是自动生成的能分享下方法吗,谢谢。
The text was updated successfully, but these errors were encountered: