aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/docs/basics.rst
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/pybind11/docs/basics.rst')
-rw-r--r--3rdparty/pybind11/docs/basics.rst20
1 files changed, 13 insertions, 7 deletions
diff --git a/3rdparty/pybind11/docs/basics.rst b/3rdparty/pybind11/docs/basics.rst
index b9d386c3..e9b24c7f 100644
--- a/3rdparty/pybind11/docs/basics.rst
+++ b/3rdparty/pybind11/docs/basics.rst
@@ -32,8 +32,7 @@ The last line will both compile and run the tests.
Windows
-------
-On Windows, only **Visual Studio 2015** and newer are supported since pybind11 relies
-on various C++11 language features that break older versions of Visual Studio.
+On Windows, only **Visual Studio 2017** and newer are supported.
.. Note::
@@ -109,7 +108,7 @@ a file named :file:`example.cpp` with the following contents:
PYBIND11_MODULE(example, m) {
m.doc() = "pybind11 example plugin"; // optional module docstring
- m.def("add", &add, "A function which adds two numbers");
+ m.def("add", &add, "A function that adds two numbers");
}
.. [#f1] In practice, implementation and binding code will generally be located
@@ -136,7 +135,14 @@ On Linux, the above example can be compiled using the following command:
.. code-block:: bash
- $ c++ -O3 -Wall -shared -std=c++11 -fPIC `python3 -m pybind11 --includes` example.cpp -o example`python3-config --extension-suffix`
+ $ c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) example.cpp -o example$(python3-config --extension-suffix)
+
+.. note::
+
+ If you used :ref:`include_as_a_submodule` to get the pybind11 source, then
+ use ``$(python3-config --includes) -Iextern/pybind11/include`` instead of
+ ``$(python3 -m pybind11 --includes)`` in the above compilation, as
+ explained in :ref:`building_manually`.
For more details on the required compiler flags on Linux and macOS, see
:ref:`building_manually`. For complete cross-platform compilation instructions,
@@ -159,12 +165,12 @@ load and execute the example:
.. code-block:: pycon
$ python
- Python 2.7.10 (default, Aug 22 2015, 20:33:39)
- [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)] on darwin
+ Python 3.9.10 (main, Jan 15 2022, 11:48:04)
+ [Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import example
>>> example.add(1, 2)
- 3L
+ 3
>>>
.. _keyword_args: