Commit Graph

18 Commits

Author SHA1 Message Date
Dean Moldovan
443ab5946b Replace PYBIND11_PLUGIN with PYBIND11_MODULE
This commit also adds `doc()` to `object_api` as a shortcut for the
`attr("__doc__")` accessor.

The module macro changes from:
```c++
PYBIND11_PLUGIN(example) {
    pybind11::module m("example", "pybind11 example plugin");
    m.def("add", [](int a, int b) { return a + b; });
    return m.ptr();
}
```

to:

```c++
PYBIND11_MODULE(example, m) {
    m.doc() = "pybind11 example plugin";
    m.def("add", [](int a, int b) { return a + b; });
}
```

Using the old macro results in a deprecation warning. The warning
actually points to the `pybind11_init` function (since attributes
don't bind to macros), but the message should be quite clear:
"PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE".
2017-05-29 03:21:19 +02:00
Lori A. Burns
5cafc99884 add CMake exported interface library and Config detection file 2016-12-13 21:44:19 +01:00
Wenzel Jakob
2fb5f1d0c3 added message about recursion limits 2016-11-16 17:37:10 +01:00
Jason Rhinelander
fb7c9fd326 Remove obsolete example reference (#457)
* Remove obsolete example reference
* Make example fully-working (except for #includes)

Fixes #456.
2016-10-22 18:54:33 +02:00
Jason Rhinelander
20ef62656f Fix minor documentation spelling mistakes 2016-09-21 13:39:02 -04:00
Wenzel Jakob
fe34241e50 minor doc & style fixes 2016-09-06 13:02:29 +09:00
Wenzel Jakob
70f5a4dc8b minor: added error message to faq 2016-09-05 17:19:18 +09:00
Wenzel Jakob
f600c1d899 updated FAQ section on Python detection 2016-06-03 14:47:54 +02:00
Wenzel Jakob
a439ccaa0e minor FAQ edits, referenced cppimport project 2016-05-17 10:47:52 +02:00
Wenzel Jakob
c62360d994 minor FAQ updates 2016-05-03 14:32:47 +02:00
Wenzel Jakob
f64feaf3e4 documentation improvements 2016-04-28 15:32:07 +02:00
Wenzel Jakob
e84f557edf documentation improvements 2016-04-26 23:48:55 +02:00
Wenzel Jakob
c79dbe425d FAQ improvements 2016-04-18 10:53:38 +02:00
Wenzel Jakob
2e03a5857c added comment about cmake issues (#99) 2016-04-14 11:27:15 +02:00
Wenzel Jakob
50ed3614de added a faq entry about import issues 2016-04-11 17:38:25 +02:00
Wenzel Jakob
a3e34f4a5f comment about old versions of visual studio 2016-03-15 15:06:47 +01:00
Wenzel Jakob
4a48afb356 doc updates 2016-03-09 21:31:21 +01:00
Wenzel Jakob
de623a7668 added faq 2016-03-09 21:11:19 +01:00