# CMAKE\_SYSTEM\_NAME defaults to Android in Termux: A semantic conflict for native builds

**URL:** https://discourse.cmake.org/t/cmake-system-name-defaults-to-android-in-termux-a-semantic-conflict-for-native-builds/15887
**Category:** Development
**Created:** [October 25, 2026, 12:45pm UTC](https://discourse.cmake.org/t/cmake-system-name-defaults-to-android-in-termux-a-semantic-conflict-for-native-builds/15887 "2026-10-25T12:45:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nsyhykui](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nsyhykui/32/6279_2.png) [@nsyhykui](https://discourse.cmake.org/u/nsyhykui)
#### Post date: [October 25, 2026, 12:45pm UTC](https://discourse.cmake.org/t/cmake-system-name-defaults-to-android-in-termux-a-semantic-conflict-for-native-builds/15887/1 "2026-10-25T12:45:36Z")

</div>

Hi CMake developers,

I am doing a native local build inside Termux.

To be precise, Termux is not a traditional Android app development environment. It is essentially a standard Linux environment, with the only difference being that it uses Android’s Bionic libc instead of Glibc. There is no Android cross-compilation (like building an APK or using the NDK) involved.

The Conceptual/Semantic Error:

In CMake’s design model, the label Android for CMAKE\_SYSTEM\_NAME historically implies cross-compilation (i.e., building an Android target from a different host). However, in Termux, this is a native build.

When CMake automatically sets CMAKE\_SYSTEM\_NAME to Android, downstream projects (like OpenCV) incorrectly assume the Android cross-compilation context and try to look for the Android SDK. This causes the build to fail because no SDK exists (and is not needed) in a native Bionic environment.

Currently, I bypass this by manually passing -DCMAKE\_SYSTEM\_NAME=Linux, which forces the native Linux path and works.

Is this considered expected behavior for native Bionic builds? Or is there an officially recommended approach to handle this semantic conflict?

Note: I used AI to help translate and structure this post. The technical issue described, the conceptual analysis, and the temporary workaround (-DCMAKE\_SYSTEM\_NAME=Linux) are entirely based on my actual experience and testing in Termux.
