# How to determine if \`clang\` or \`clang-cl\` is used on Windows?

**URL:** https://discourse.cmake.org/t/how-to-determine-if-clang-or-clang-cl-is-used-on-windows/4129
**Category:** Code
**Created:** [September 21, 2021, 12:51pm UTC](https://discourse.cmake.org/t/how-to-determine-if-clang-or-clang-cl-is-used-on-windows/4129 "2021-09-21T12:51:38Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![dbahadir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dbahadir/32/197_2.png) [@dbahadir](https://discourse.cmake.org/u/dbahadir)
#### Post date: [September 22, 2021, 10:22am UTC](https://discourse.cmake.org/t/how-to-determine-if-clang-or-clang-cl-is-used-on-windows/4129/5 "2021-09-22T10:22:14Z")

</div>

Sadly, I realized that `CMAKE_<LANG>_SIMULATE_ID` is not really helpful.

Whether I use `clang` or `clang-cl` it always evaluates to `MSVC`.  
`CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT` on the other hand only evaluates to `MSVC` if using `clang-cl` and to `GNU` for `clang`.

So what I really need to pass options to Clang with the correct format is `CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT`.

Is there any reason, why that variable is supposed to be a CMake-internal one?

I would suggest to officially expose it to users and to provide proper documentation to both variables, because the documentation for `CMAKE_<LANG>_SIMULATE_ID` seems not to reflect what that variable really shows. (It seems more as if `CMAKE_<LANG>_SIMULATE_ID` determines if I am calling Clang from a Visual Studio prompt but not in what _driver-mode_ it is running.)

---

_[View the full topic](https://discourse.cmake.org/t/how-to-determine-if-clang-or-clang-cl-is-used-on-windows/4129)._
