From 3a8b6653dcd3b860957f6dfbe7d764b695b29d28 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 11 Jan 2022 16:31:42 -0500 Subject: MSVC: Use -external:I flag without space to support Clang tools Since commit f29e1874ad (Compiler/MSVC: use the `-external:I` flag for system includes, 2020-05-19, v3.22.0-rc1~593^2) we use the new flag followed by the include directory as a separate argument. Some versions of `clang-cl` and `clang-tidy` do not support the flag unless the include directory is attached to it, so use that form instead. Fixes: #22979 --- Modules/Compiler/MSVC-C.cmake | 2 +- Modules/Compiler/MSVC-CXX.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake index a53df46..df3691c 100644 --- a/Modules/Compiler/MSVC-C.cmake +++ b/Modules/Compiler/MSVC-C.cmake @@ -77,6 +77,6 @@ endif() # The `/external:I` flag was made non-experimental in 19.29.30036.3. if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036.3) - set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-external:I ") + set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-external:I") set(_CMAKE_INCLUDE_SYSTEM_FLAG_C_WARNING "-external:W0 ") endif () diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index bcaec69..17cbc3c 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -84,6 +84,6 @@ endif() # The `/external:I` flag was made non-experimental in 19.29.30036.3. if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036.3) - set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-external:I ") + set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-external:I") set(_CMAKE_INCLUDE_SYSTEM_FLAG_CXX_WARNING "-external:W0 ") endif () -- cgit v0.12