# Cmake cannot identifies my llvm toolchain on windows

**URL:** https://discourse.cmake.org/t/cmake-cannot-identifies-my-llvm-toolchain-on-windows/7418
**Category:** Usage
**Tags:** os:windows, gen:ninja
**Created:** [February 7, 2023, 11:51am UTC](https://discourse.cmake.org/t/cmake-cannot-identifies-my-llvm-toolchain-on-windows/7418 "2023-02-07T11:51:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Dr-Itachi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dr-itachi/32/2899_2.png) [@Dr-Itachi](https://discourse.cmake.org/u/Dr-Itachi)
#### Post date: [February 7, 2023, 11:51am UTC](https://discourse.cmake.org/t/cmake-cannot-identifies-my-llvm-toolchain-on-windows/7418/1 "2023-02-07T11:51:45Z")

</div>

Hello. I have a problem. Cmake can’t identify my LLVM/Clang installation on Windows. I am configuring a project for cross-compilation using clang but Cmake cannot configure my project.

Here is the output from cmake:

```auto
[main] Building folder: Firmware 
[main] Configuring project: Firmware 
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/cmake/arm-none-eabi.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/install/debug -SC:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware -BC:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/debug -G Ninja
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] -- The ASM compiler identification is Clang with GNU-like command-line
[cmake] -- Found assembler: C:/LLVM_Arm_Embedded_Toolchain/bin/clang.exe
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: C:/LLVM_Arm_Embedded_Toolchain/bin/clang.exe
[cmake] -- Check for working C compiler: C:/LLVM_Arm_Embedded_Toolchain/bin/clang.exe - broken
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
[cmake] The C compiler
[cmake] 
[cmake] "C:/LLVM_Arm_Embedded_Toolchain/bin/clang.exe"
[cmake] 
[cmake] is not able to compile a simple test program.
[cmake] 
[cmake] It fails with the following output:
[cmake] 
[cmake] Change Dir: C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/debug/CMakeFiles/CMakeScratch/TryCompile-l7rkxv
[cmake]     
[cmake] Run Build Command(s):C:/PROGRA~1/Ninja/ninja.exe cmTC_4b937 && [1/2] Building C object CMakeFiles\cmTC_4b937.dir\testCCompiler.c.obj
[cmake] FAILED: CMakeFiles/cmTC_4b937.dir/testCCompiler.c.obj 
[cmake] C:\LLVM_Arm_Embedded_Toolchain\bin\clang.exe -o CMakeFiles\cmTC_4b937.dir\testCCompiler.c.obj -c C:\Users\herma\OneDrive\Bureau\Hermann\EBIKE\Codes\Firmware\build\debug\CMakeFiles\CMakeScratch\TryCompile-l7rkxv\testCCompiler.c
[cmake] error: unable to create target: 'No available targets are compatible with triple "x86_64-w64-windows-gnu"'
[cmake] 1 error generated.
[cmake] ninja: build stopped: subcommand failed.
[cmake]     
[cmake]     
[cmake] 
[cmake]   
[cmake] 
[cmake] CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:13 (project)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/debug/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/debug/CMakeFiles/CMakeError.log".
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/cmake/arm-none-eabi.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=C:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/install/debug -SC:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware -BC:/Users/herma/OneDrive/Bureau/Hermann/EBIKE/Codes/Firmware/build/debug -G Ninja exited with code: 1

```

---

<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: [February 8, 2023, 5:12pm UTC](https://discourse.cmake.org/t/cmake-cannot-identifies-my-llvm-toolchain-on-windows/7418/2 "2023-02-08T17:12:12Z")

</div>

> [@Dr-Itachi](#):
>
> `[cmake] error: unable to create target: 'No available targets are compatible with triple "x86_64-w64-windows-gnu"'`

It looks like the toolchain file needs to set some flags to make it not try to target Windows (or prevent CMake from making it do that targeting).
