如何在介子构建系统管理的 python 介子项目中正确包含 cython 源文件?
Cython 作为一流的语言仍在开发中(我是这项工作的作者),现在正确的方法是使用生成器或自定义目标,然后编译扩展模块:
pyx_c = custom_target(
'cython_file.c',
output : 'cython_file.c',
input : 'cython_fiule.pyx',
command : [cython, '@INPUT@', '-o', '@OUTPUT@'],
)
import('python').find_installation().extension_module(
'my_extension_module'
pyx_c,
install : true
)
这是介子测试套件中的一个示例,它与我上面的示例非常接近。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句