# How to determine host architecture before to the project call?

**URL:** https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887
**Category:** Usage
**Tags:** os:ios
**Created:** [January 20, 2024, 2:16am UTC](https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887 "2024-01-20T02:16:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)
#### Post date: [January 20, 2024, 2:16am UTC](https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887/1 "2024-01-20T02:16:22Z")

</div>

In my project I’m allowing the user to configure library either for device or simulator. When targeting device I just hardcode arm64, but the simulator architecture follow the host device. Unfortunately I cannot use `CMAKE_HOST_SYSTEM_PROCESSOR` as this choice needs to be made prior the `project` call to set various variables.

What are my other options?

---

<div class="post-metadata">

### Author: ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)
#### Post date: [January 20, 2024, 4:30am UTC](https://discourse.cmake.org/t/how-to-determine-host-architecture-before-to-the-project-call/9887/2 "2024-01-20T04:30:03Z")

</div>

Answering my own question:

```
cmake_host_system_information(RESULT _simulator_arch QUERY OS_PLATFORM)

```

did the trick.
