fix: cross-compilation updates (#5829)

* Android updates

* Revert removal of Interpreter
This commit is contained in:
Malcolm Smith
2026-01-20 22:35:16 +00:00
committed by GitHub
parent a8e223d0cd
commit 53ccc32f84
5 changed files with 64 additions and 33 deletions

View File

@@ -41,7 +41,18 @@ set(pybind11_INCLUDE_DIRS
"${pybind11_INCLUDE_DIR}"
CACHE INTERNAL "Include directory for pybind11 (Python not requested)")
if(CMAKE_CROSSCOMPILING AND PYBIND11_USE_CROSSCOMPILING)
# CMP0190 prohibits calling FindPython with both Interpreter and Development components
# when cross-compiling, unless the CMAKE_CROSSCOMPILING_EMULATOR variable is defined.
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.1")
cmake_policy(GET CMP0190 _pybind11_cmp0190)
if(_pybind11_cmp0190 STREQUAL "NEW")
set(PYBIND11_USE_CROSSCOMPILING "ON")
endif()
endif()
if(CMAKE_CROSSCOMPILING
AND PYBIND11_USE_CROSSCOMPILING
AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
set(_PYBIND11_CROSSCOMPILING
ON
CACHE INTERNAL "")