Commit 2fc5e5db authored by Brad King's avatar Brad King
Browse files

Clang: Use -imsvc for system include only with MSVC-like front-end

In commit bb61c2d0 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we added `-imsvc`
for all Clang compilers targeting the MSVC ABI.  However, the option
only exists for the MSVC-like front-end.  The GNU-like front-ends
use `-isystem`.

Fixes: #21789
parent 340ca27f
Pipeline #213547 waiting for manual action with stages
in 7 minutes and 1 second
......@@ -19,7 +19,6 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
macro(__compiler_clang lang)
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc ")
endmacro()
else()
include(Compiler/GNU)
......
......@@ -169,6 +169,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 ")
endmacro()
else()
cmake_policy(GET CMP0091 __WINDOWS_CLANG_CMP0091)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment