Skip to content

VS: Fix detection of clang-cl with -T llvm

Brad King requested to merge brad.king/cmake:vs-llvm-extension into master

When using a VS generator with -T llvm, MSBuild relies on the "LLVM Compiler Toolchain" VS Extension. This does not put clang-cl in the PATH inside the build, and LLVM no longer provides a cl replacement either. Therefore we need another way to extract the path to the CMAKE_{C,CXX}_COMPILER. Fortunately the LLVM VS integration provides a $(ClangClExecutable) macro we can reference to get the path.

Fixes: #18983 (closed)

Merge request reports