diff options
author | Brad King <brad.king@kitware.com> | 2020-01-28 16:01:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-28 16:01:19 (GMT) |
commit | 193352e420f8a21300d80ca115da2858a7f27ae6 (patch) | |
tree | 62b08330bbfd976d0cdede96abc4884fcbf63ff2 /Modules/Compiler | |
parent | e3be80f4fc1d6fedf45666b7d18dda12ef20054e (diff) | |
parent | f6f4eb090714df50b77b164bbd5bb65a8ce59cbc (diff) | |
download | CMake-193352e420f8a21300d80ca115da2858a7f27ae6.zip CMake-193352e420f8a21300d80ca115da2858a7f27ae6.tar.gz CMake-193352e420f8a21300d80ca115da2858a7f27ae6.tar.bz2 |
Merge topic 'clang-tidy-driver-mode'
f6f4eb0907 clang-tidy: Add driver mode argument
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4208
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/Intel-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 2 |
6 files changed, 15 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 0448965..7c4a263 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -6,6 +6,10 @@ if(APPLE AND NOT appleClangPolicy STREQUAL NEW) return() endif() +if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") + set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") +endif() + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") 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) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index e9e59a2..ec3bfd8 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -9,6 +9,8 @@ set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <OBJECT> -MF <DEPFILE>") if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 16.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Qstd=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-Qstd=c11") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index b630a6b..1ed1b08 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -9,6 +9,8 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>") if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0) set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17") set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17") diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake index 20787a3..bca9764 100644 --- a/Modules/Compiler/MSVC-C.cmake +++ b/Modules/Compiler/MSVC-C.cmake @@ -11,6 +11,8 @@ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "") # There is no meaningful default for this set(CMAKE_C_STANDARD_DEFAULT "") +set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + # There are no C compiler modes so we hard-code the known compiler supported # features. Override the default macro for this special case. Pretend that # all language standards are available so that at least compilation diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 915295d..1dfc760 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -3,6 +3,8 @@ include(Compiler/CMakeCommonCompilerMacros) +set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017) |