如何使用 waf 为 gir 文件生成类型库
我使用以下 wscript_build 代码片段及其 gir 文件构建 vala 库:
lib = bld.shlib (
features = 'c cshlib',
target = 'sample',
name = 'libsample',
vnum = '0.0.0',
vapi_dirs = '../vapi',
uselib = 'GTK',
cflags = ['-include', 'config.h'],
gir = 'Sample-1.0',
packages = 'gtk+-3.0',
packages_private = 'config',
source = bld.path.ant_glob (incl='**/*.vala'))
但是现在我想知道如何使用 waf 从该 gir 文件构建 typelib?
I use the following wscript_build snippet to build a vala library with its gir file:
lib = bld.shlib (
features = 'c cshlib',
target = 'sample',
name = 'libsample',
vnum = '0.0.0',
vapi_dirs = '../vapi',
uselib = 'GTK',
cflags = ['-include', 'config.h'],
gir = 'Sample-1.0',
packages = 'gtk+-3.0',
packages_private = 'config',
source = bld.path.ant_glob (incl='**/*.vala'))
However now I'm wondering how to build a typelib from this gir file with waf?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
debian 包 gobject-introspection 中提供的工具 g-ir-compiler 将 gir 文件转换为 typelib(另请参阅 这个问题)
可以在 wscript_build 中使用以下任务定义,以使用此工具在 waf 中构建类型库并将其安装到/usr/lib/girepository-1.0 它所属的地方。
有关完整示例,请参阅此处
The tool g-ir-compiler available in the debian package gobject-introspection converts a gir file to a typelib (also see this question)
Following task definition can be used within wscript_build to use this tool to build a typelib within waf and install such to /usr/lib/girepository-1.0 where it belongs.
For a complete sample also see here