# How is CMAKE\_\<LANG\>\_COMPILER\_AR determined automatically?

**URL:** https://discourse.cmake.org/t/how-is-cmake-lang-compiler-ar-determined-automatically/7011
**Category:** Development
**Created:** [December 2, 2022, 9:14pm UTC](https://discourse.cmake.org/t/how-is-cmake-lang-compiler-ar-determined-automatically/7011 "2022-12-02T21:14:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tni](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tni](https://discourse.cmake.org/u/tni)
#### Post date: [December 2, 2022, 9:14pm UTC](https://discourse.cmake.org/t/how-is-cmake-lang-compiler-ar-determined-automatically/7011/1 "2022-12-02T21:14:47Z")

</div>

For context, I am a newcomer to CMake with a build that I observe failing on x86\_64-darwin complaining that `CMAKE_CXX_COMPILER_AR` is not found, but the same build does not fail on x86\_64-linux. Now, there are a lot of layers I still need to peel back before I can understand my issue, but I’d like to start with a simple question that I haven’t been able to figure out:

How is `CMAKE_<LANG>_COMPILER_AR` computed by default, and where in the CMake code can I look to find this logic?

Thank you in advance!

Teddy

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 5, 2022, 9:52pm UTC](https://discourse.cmake.org/t/how-is-cmake-lang-compiler-ar-determined-automatically/7011/2 "2022-12-05T21:52:12Z")

</div>

This usually means that Xcode is not installed/found IIRC. Are they using something like Homebrew or expecting to use the Xcode toolchain?
