我有一些包含文档的C API,例如
// file: my_module.h
/**
* My function.
* @param x A number.
* @return Return.
*/
extern int my_function(int x);
我的swig文件
%module my_module
%{
#include "my_module.h"
%}
%include "my_module.h"
例如,如果我为python生成包装器,我将生成此python包装器函数
# file: my_module.py
# < I want my docs copied here
def my_function(x):
return _my_module.my_function(x)
是否有一种方法可以告诉SWIG将我的文档复制到输出,以便在使用包装程序时可以在python编辑器的intellisense中看到我的文档?
我还没有尝试过,但是SWIG 4.0对doxygen注释提供了一些支持: