mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
fix: cross-compilation updates (#5829)
* Android updates * Revert removal of Interpreter
This commit is contained in:
@@ -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 "")
|
||||
|
||||
Reference in New Issue
Block a user