How to specify GNU-like Clang for `Visual Studio 16 2019` generator?

Problem Descriptions

There are two types of Clang compilers after I install Clang/LLVM:

  • clang.exe/clang++.exe: GNU-like Clang compiler
  • clang-cl.exe: MSVC-like Clang compiler

According to this issue, we can specify MSVC-like clang-cl.exe with the following arguments:

  • -T ClangCL for Visual Studio 16 2019.
  • -T LLVM for Visual Studio 15 2017.

I was wondering how to specify the GNU-like clang.exe/clang++.exe for Visual Studio 16 2019?

I don’t think there’s a Visual Studio toolchain configuration for those toolchains. Well, there might be, but Visual Studio kind of assumes a cl-like command line interface IIRC. The closest thing you can do is use the Ninja generator and use Visual Studio’s CMake integration.