From 66490f05369c9df86f605f2e87725dde3de6816c Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Sat, 20 Sep 2025 23:50:51 +0100 Subject: [PATCH] Add CMAKE_CROSSCOMPILING_EMULATOR to Android CMake toolchain (#2591) --- cibuildwheel/platforms/android.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cibuildwheel/platforms/android.py b/cibuildwheel/platforms/android.py index b3f614fb..cb57b907 100644 --- a/cibuildwheel/platforms/android.py +++ b/cibuildwheel/platforms/android.py @@ -274,11 +274,15 @@ def create_cmake_toolchain( set(CMAKE_SYSTEM_VERSION 1) # Tell CMake where to look for headers and libraries. - list(INSERT CMAKE_FIND_ROOT_PATH 0 {python_dir}/prefix) + set(CMAKE_FIND_ROOT_PATH "{python_dir}/prefix") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) + + # Allow CMake to run Python in the simulated Android environment when + # policy CMP0190 is active. + set(CMAKE_CROSSCOMPILING_EMULATOR /bin/sh -c [["$0" "$@"]]) """ ), file=toolchain_file,