mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
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
This commit is contained in:
@@ -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 ()
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user