Skip to content

clang-tidy: Add driver mode argument

Hanjiang Yu requested to merge de1acr0ix/cmake:clang-tidy-driver-mode into master

clang-tidy does not infer driver mode if it is not provided with a JSON compilation database. This is exactly the way cmake launches it. Hence clang-tidy will only use the default driver mode. This PR tries to infer driver mode from compiler identity.

  • If compiler is MSVC driver mode is set to cl.
  • Otherwise it is set to gcc or g++ depending on the language.
Edited by Brad King

Merge request reports