Updated folder
This commit is contained in:
parent
e3e111e07f
commit
281aabf05b
5 changed files with 0 additions and 1 deletions
40
python/src/main.cpp
Normal file
40
python/src/main.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <pybind11/pybind11.h>
|
||||
|
||||
int add(int i, int j) {
|
||||
return i + j;
|
||||
}
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
PYBIND11_MODULE(cmake_example, m) {
|
||||
m.doc() = R"pbdoc(
|
||||
Pybind11 example plugin
|
||||
-----------------------
|
||||
|
||||
.. currentmodule:: cmake_example
|
||||
|
||||
.. autosummary::
|
||||
:toctree: _generate
|
||||
|
||||
add
|
||||
subtract
|
||||
)pbdoc";
|
||||
|
||||
m.def("add", &add, R"pbdoc(
|
||||
Add two numbers
|
||||
|
||||
Some other explanation about the add function.
|
||||
)pbdoc");
|
||||
|
||||
m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc(
|
||||
Subtract two numbers
|
||||
|
||||
Some other explanation about the subtract function.
|
||||
)pbdoc");
|
||||
|
||||
#ifdef VERSION_INFO
|
||||
m.attr("__version__") = VERSION_INFO;
|
||||
#else
|
||||
m.attr("__version__") = "dev";
|
||||
#endif
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue