Clang: Use -imsvc flag without space to support Clang tools

Since commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we use the `-imsvc`
flag followed by the include directory as a separate argument.  Some
versions of `clang-tidy` do not support the flag unless the include
directory is attached to it, so use that form instead.

A similar fix was made by commit 3a8b6653dc (MSVC: Use -external:I flag
without space to support Clang tools, 2022-01-11, v3.22.2~8^2).

Fixes: #23517
This commit is contained in:
Brad King
2022-05-17 11:08:21 -04:00
parent 5b3096198a
commit 23a52561c7

View File

@@ -182,7 +182,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
macro(__windows_compiler_clang_base lang)
set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
__windows_compiler_msvc(${lang})
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc ")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc")
endmacro()
else()
cmake_policy(GET CMP0091 __WINDOWS_CLANG_CMP0091)