What version (or hash if on master) of pybind11 are you using?
v2.11.1
Problem description
I'm trying to migrate our project from old FindPythonInterp and FindPythonLibs cmake modules to new FindPython3.
We are using cross-compilation in our project to compile ARM64 C++ and Python binaries.
In order to have a proper python extension for compiled modules, I used PYTHON_MODULE_EXTENSION. But with migration to new cmake python modules, it triggers different code path inside pybind11. In fact, PYTHON_MODULE_EXTENSION ignores my value set via cmake cmd.
pybind11 has a cmake option PYBIND11_PYTHONLIBS_OVERWRITE, maybe we need to introduce something for FindPython3.cmake case? Or completely remove such under for the first cmake iteration.
Reproducible example code
See above
Is this a regression? Put the last known working version here if it is.
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
v2.11.1
Problem description
I'm trying to migrate our project from old FindPythonInterp and FindPythonLibs cmake modules to new FindPython3. We are using cross-compilation in our project to compile ARM64 C++ and Python binaries.
In order to have a proper python extension for compiled modules, I used
PYTHON_MODULE_EXTENSION
. But with migration to new cmake python modules, it triggers different code path inside pybind11. In fact,PYTHON_MODULE_EXTENSION
ignores my value set via cmake cmd.This because of first run, pybind11 checks: https://github.com/pybind/pybind11/blob/5891867ee4ad1d671e0f54c5fb30f62d1322d8d0/tools/pybind11NewTools.cmake#L76-L83 While
PYBIND11_PYTHON_EXECUTABLE_LAST
is empty and unsets user-specified value forPYTHON_MODULE_EXTENSION
. And later it setsPYTHON_MODULE_EXTENSION
which results in build platform prefix: https://github.com/pybind/pybind11/blob/5891867ee4ad1d671e0f54c5fb30f62d1322d8d0/tools/pybind11NewTools.cmake#L98-L128pybind11 has a cmake option
PYBIND11_PYTHONLIBS_OVERWRITE
, maybe we need to introduce something for FindPython3.cmake case? Or completely remove such under for the first cmake iteration.Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression