Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/pybind11Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ set(pybind11_INCLUDE_DIRS

# 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")
# An emulator can run the target interpreter, so it only suppresses this default; a project
# that asks for cross-compiling support explicitly always gets it (see #6043).
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.1" AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
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)
if(CMAKE_CROSSCOMPILING AND PYBIND11_USE_CROSSCOMPILING)
set(_PYBIND11_CROSSCOMPILING
ON
CACHE INTERNAL "")
Expand Down
Loading