Skip to content

Commit 60a0817

Browse files
mhsmithhenryiii
authored andcommitted
Revert removal of Interpreter
1 parent 21ba5d0 commit 60a0817

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

docs/compiling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ FindPython, pybind11 will detect this and use the existing targets instead:
495495
cmake_minimum_required(VERSION 3.15...4.0)
496496
project(example LANGUAGES CXX)
497497
498-
find_package(Python COMPONENTS Development.Module REQUIRED)
498+
find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED)
499499
find_package(pybind11 CONFIG REQUIRED)
500500
# or add_subdirectory(pybind11)
501501

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ There are three possible solutions:
324324
from CMake and rely on pybind11 in detecting Python version. If this is not
325325
possible, the CMake machinery should be called *before* including pybind11.
326326
2. Set ``PYBIND11_FINDPYTHON`` to ``True`` or use ``find_package(Python
327-
COMPONENTS Development.Module)`` on modern CMake ( 3.18.2+ best).
327+
COMPONENTS Interpreter Development)`` on modern CMake ( 3.18.2+ best).
328328
Pybind11 in these cases uses the new CMake FindPython instead of the old,
329329
deprecated search tools, and these modules are much better at finding the
330330
correct Python. If FindPythonLibs/Interp are not available (CMake 3.27+),

docs/upgrade.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ In addition, the following changes may be of interest:
334334
``pybind11_add_module`` if set instead of linking to ``pybind11::lto`` or
335335
``pybind11::thin_lto``.
336336

337-
* Using ``find_package(Python COMPONENTS Development.Module)`` before
337+
* Using ``find_package(Python COMPONENTS Interpreter Development)`` before
338338
pybind11 will cause pybind11 to use the new Python mechanisms instead of its
339339
own custom search, based on a patched version of classic ``FindPythonInterp``
340340
/ ``FindPythonLibs``. In the future, this may become the default. A recent

tools/pybind11Common.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.1")
5050
endif()
5151
endif()
5252

53-
if(CMAKE_CROSSCOMPILING AND PYBIND11_USE_CROSSCOMPILING)
53+
if(CMAKE_CROSSCOMPILING
54+
AND PYBIND11_USE_CROSSCOMPILING
55+
AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
5456
set(_PYBIND11_CROSSCOMPILING
5557
ON
5658
CACHE INTERNAL "")

tools/pybind11Config.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ default to ``ON``.
7777
New FindPython mode
7878
^^^^^^^^^^^^^^^^^^^
7979
80-
To activate this mode, either call ``find_package(Python COMPONENTS Development.Module)``
80+
To activate this mode, either call ``find_package(Python COMPONENTS Interpreter Development)``
8181
before finding this package, or set the ``PYBIND11_FINDPYTHON`` variable to ON. In this mode,
8282
you can either use the basic targets, or use the FindPython tools:
8383
8484
.. code-block:: cmake
8585
86-
find_package(Python COMPONENTS Development.Module)
86+
find_package(Python COMPONENTS Interpreter Development)
8787
find_package(pybind11 CONFIG)
8888
8989
# pybind11 method:

0 commit comments

Comments
 (0)