一个用于快速python c++绑定构建的小程序包。

ccimport的Python项目详细描述


ccimport公司

Build Status

一个用于快速构建pythoncc++绑定的小软件包。在

支持Python3.5、3.7-3.9。在

使用

代码的限制

  • 不支持带有模板参数的函数/类。如果确实需要使用模板,则需要为所有参数提供默认值。生成的代码将使用func<>绑定代码。在

单个文件扩展名

  • 在函数声明名之前添加CODEAI_EXPORT。对于类,编写一个静态工厂成员,该成员返回一个唯一的\u ptr,然后在其前面添加CODEAI_EXPORT_INIT。在

  • 使用ccimport.autoimport生成扩展。在

多文件扩展名

  • 在头文件中添加CODEAI_EXPORT和/或CODEAI_EXPORT_INIT。在

  • 在源文件中实现函数和类。在

  • 使用ccimport.autoimport生成扩展。您需要将带有CODEAI_EXPORT的所有头文件添加到sources参数中。在

没有pybind的库

  • 使用ccimport.ccimport公司相反。在

美国石油学会

  • 在ccimport.自动导入在
defautoimport(sources:List[Union[str,Path]],# list of source path, may include headers with 'CODEAI_EXPORT'out_path:Union[str,Path],# output path. the name of output file must be a name # without platform library prefix and suffix such as `lib-`, '.so'.includes:Optional[List[Union[str,Path]]]=None,# include pathslibpaths:Optional[List[Union[str,Path]]]=None,# library pathslibraries:Optional[List[str]]=None,# libraries. the name of library must be a name # without platform library prefix and suffix such as `lib-`, '.so'.export_kw="CODEAI_EXPORT",# use the macro to mark a exported function.export_init_kw="CODEAI_EXPORT_INIT",# use the macro to mark a static class factory member.compile_options:Optional[List[str]]=None,# compile options.link_options:Optional[List[str]]=None,# link options.std="c++14",# c++ standard.additional_cflags:Optional[Dict[str,List[str]]]=None):# compiler to compile optionspass
  • 在ccimport.ccimport公司在
^{pr2}$

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法将自定义数据类型转换为字符串?   JavaLog4j和appender,这个Log4j定义正确吗?   用于换行的java Android Eclipse拆分   与某个方法关联的java启用/禁用JButton   java小部件列表视图加载视图   java国家/地区名称中的正则表达式   从Java调用Kotlin时,如何获取错误的行号?   java将视图传递给AsyncTask以访问findViewById   java SQL性能:多个绑定还是绑定到一个SQL变量以供重用?   BluetoothAdapter上的安卓 Java NullPointerException。isEnabled()   在clojure中取消引用java方法   JAVA网SocketException:IP_添加_成员身份失败(硬件筛选器不足?)   java从类对象的方法接收nullpointer异常   java使用for循环创建多个对象   java无法使用NTLM身份验证apache camel cxf   java Eclipse不喜欢@Override注释   java Spark SQL模拟红移(Oracle)“系统日期”或“当前日期”