summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-11 21:31:42 (GMT)
committerBrad King <brad.king@kitware.com>2022-01-11 21:36:36 (GMT)
commit3a8b6653dcd3b860957f6dfbe7d764b695b29d28 (patch)
tree624acabd3a18cc4c9302c3e892adc1bfdd9c1661 /Modules
parent4b8126fa409e8558f465c70eaa794dab82819d8d (diff)
downloadCMake-3a8b6653dcd3b860957f6dfbe7d764b695b29d28.zip
CMake-3a8b6653dcd3b860957f6dfbe7d764b695b29d28.tar.gz
CMake-3a8b6653dcd3b860957f6dfbe7d764b695b29d28.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/MSVC-C.cmake2
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake2
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 ()