mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
fix: add flag for overriding classic Python search values (#4195)
* fix: PyPy needs to overrite broken FindPythonInterp values Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: add flag to opt-in to new (cross-compile) behavior Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Apply suggestions from code review Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
parent
8ea75ab4d7
commit
4fe905d4f0
@ -151,9 +151,13 @@ if(NOT _PYTHON_SUCCESS MATCHES 0)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(
|
||||||
|
PYBIND11_PYTHONLIBS_OVERWRITE
|
||||||
|
"Overwrite cached values read from Python library (classic search). Turn off if cross-compiling and manually setting these values."
|
||||||
|
ON)
|
||||||
# Can manually set values when cross-compiling
|
# Can manually set values when cross-compiling
|
||||||
macro(_PYBIND11_GET_IF_UNDEF lst index name)
|
macro(_PYBIND11_GET_IF_UNDEF lst index name)
|
||||||
if(NOT DEFINED "${name}")
|
if(PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED "${name}")
|
||||||
list(GET "${lst}" "${index}" "${name}")
|
list(GET "${lst}" "${index}" "${name}")
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
Loading…
Reference in New Issue
Block a user