There was an error while loading. Please reload this page.
2 parents d44676e + 4e9d379 commit 6fd9effCopy full SHA for 6fd9eff
1 file changed
CMakeLists.txt
@@ -1,5 +1,16 @@
1
cmake_minimum_required(VERSION 3.15...3.26)
2
3
+# --- BEGIN ANDROID CROSS-COMPILATION FIX ---
4
+# Buildozer/python-for-android uses standard pip install which doesn't natively
5
+# pass a CMake toolchain file to scikit-build-core. This detects the Android compiler
6
+# from the environment and forces CMake into cross-compilation mode to prevent
7
+# it from building host (x86_64) binaries.
8
+if("$ENV{CC}" MATCHES "android" AND NOT DEFINED CMAKE_SYSTEM_NAME)
9
+ message(STATUS "Detected Android cross-compilation via environment variables. Setting CMAKE_SYSTEM_NAME=Android")
10
+ set(CMAKE_SYSTEM_NAME Android)
11
+endif()
12
+# --- END ANDROID CROSS-COMPILATION FIX ---
13
+
14
project(${SKBUILD_PROJECT_NAME} LANGUAGES C)
15
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
16
0 commit comments