diff options
author | PigeonF <fnoegip@gmail.com> | 2021-09-08 17:08:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-10 13:53:31 (GMT) |
commit | ccfe1b0b401863a8ac9ef07bb88ef970af587edc (patch) | |
tree | 677d05150c8e1605f2b4fe5d0df841260abc2579 /Modules/Compiler | |
parent | cf5ed709915bde5cef4a649ca2255833cc7afcd3 (diff) | |
download | CMake-ccfe1b0b401863a8ac9ef07bb88ef970af587edc.zip CMake-ccfe1b0b401863a8ac9ef07bb88ef970af587edc.tar.gz CMake-ccfe1b0b401863a8ac9ef07bb88ef970af587edc.tar.bz2 |
IWYU: Add `--driver-mode=cl` when applicable
We already do this for `clang-tidy`.
Fixes: #16554
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/Intel-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/Intel-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/IntelLLVM-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/IntelLLVM-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Compiler/MSVC-CXX.cmake | 1 |
8 files changed, 8 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index cf493d7..1b765ad 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -9,6 +9,7 @@ endif() if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC) set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_C_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" AND CMAKE_DEPFILE_FLAGS_C) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 98828e0..84b05d7 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -22,6 +22,7 @@ endif() if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) AND CMAKE_GENERATOR MATCHES "Makefiles" AND CMAKE_DEPFILE_FLAGS_CXX) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index ead9069..9884b58 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -17,6 +17,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC) set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_C_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 16.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Qstd=c11") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index 37f339a..7c9cca9 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -16,6 +16,7 @@ endif() if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0) set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20") diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake index d69d064..d7346f6 100644 --- a/Modules/Compiler/IntelLLVM-C.cmake +++ b/Modules/Compiler/IntelLLVM-C.cmake @@ -4,6 +4,7 @@ __compiler_intel_llvm(C) if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC) set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_C_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" AND CMAKE_DEPFILE_FLAGS_C) diff --git a/Modules/Compiler/IntelLLVM-CXX.cmake b/Modules/Compiler/IntelLLVM-CXX.cmake index 9799888..cae1f11 100644 --- a/Modules/Compiler/IntelLLVM-CXX.cmake +++ b/Modules/Compiler/IntelLLVM-CXX.cmake @@ -4,6 +4,7 @@ __compiler_intel_llvm(CXX) if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TP) set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl") if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" AND CMAKE_DEPFILE_FLAGS_CXX) diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake index 73cca36..4ba1eea 100644 --- a/Modules/Compiler/MSVC-C.cmake +++ b/Modules/Compiler/MSVC-C.cmake @@ -29,6 +29,7 @@ endif() set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC) set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") +set(CMAKE_C_INCLUDE_WHAT_YOU_USE_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 diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 09fe851..9bb7722 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -4,6 +4,7 @@ include(Compiler/CMakeCommonCompilerMacros) set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl") +set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_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 |