diff options
author | Hanjiang Yu <42531996+de1acr0ix@users.noreply.github.com> | 2020-01-19 08:39:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-27 18:59:05 (GMT) |
commit | f6f4eb090714df50b77b164bbd5bb65a8ce59cbc (patch) | |
tree | deb85ea2868c93016388410f8b22750aeb7323f3 /Modules/Compiler/Clang-CXX.cmake | |
parent | 33e7bd66c09ee51edbbccfc1014813e30d80ec5f (diff) | |
download | CMake-f6f4eb090714df50b77b164bbd5bb65a8ce59cbc.zip CMake-f6f4eb090714df50b77b164bbd5bb65a8ce59cbc.tar.gz CMake-f6f4eb090714df50b77b164bbd5bb65a8ce59cbc.tar.bz2 |
clang-tidy: Add driver mode argument
`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. Add an explicit
driver mode argument to avoid this.
Diffstat (limited to 'Modules/Compiler/Clang-CXX.cmake')
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 61709f8..cb240f9 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -10,6 +10,9 @@ if(APPLE AND NOT appleClangPolicy STREQUAL NEW) return() endif() +if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") + set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") +endif() if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1) |