# CMake doesn't let me use my own compiler when targeting Android

**URL:** https://discourse.cmake.org/t/cmake-doesnt-let-me-use-my-own-compiler-when-targeting-android/15080
**Category:** Usage
**Created:** [August 20, 2025, 8:52pm UTC](https://discourse.cmake.org/t/cmake-doesnt-let-me-use-my-own-compiler-when-targeting-android/15080 "2025-08-20T20:52:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mccakit](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mccakit/32/5628_2.png) [@mccakit](https://discourse.cmake.org/u/mccakit)
#### Post date: [August 20, 2025, 8:52pm UTC](https://discourse.cmake.org/t/cmake-doesnt-let-me-use-my-own-compiler-when-targeting-android/15080/1 "2025-08-20T20:52:52Z")

</div>

When I specify sysroot, cmake tries to look for gcc compilers, which is absurd.  
When I specify ndk directory cmake tries to use ndk clang regardless of what input for the compilers I give, even forced cache variables don’t work.

I want to be able to use my own compiler when targeting android, is it a me issue or CMake doesn’t allow this?
