Skip to content

Commit 66490f0

Browse files
authored
Add CMAKE_CROSSCOMPILING_EMULATOR to Android CMake toolchain (#2591)
1 parent 77b9e35 commit 66490f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cibuildwheel/platforms/android.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,15 @@ def create_cmake_toolchain(
274274
set(CMAKE_SYSTEM_VERSION 1)
275275
276276
# Tell CMake where to look for headers and libraries.
277-
list(INSERT CMAKE_FIND_ROOT_PATH 0 {python_dir}/prefix)
277+
set(CMAKE_FIND_ROOT_PATH "{python_dir}/prefix")
278278
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
279279
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
280280
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
281281
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
282+
283+
# Allow CMake to run Python in the simulated Android environment when
284+
# policy CMP0190 is active.
285+
set(CMAKE_CROSSCOMPILING_EMULATOR /bin/sh -c [["$0" "$@"]])
282286
"""
283287
),
284288
file=toolchain_file,

0 commit comments

Comments
 (0)