Commit 1c3404a3 authored by Brad King's avatar Brad King
Browse files

Merge branch 'clang-frontend-variant' into release-3.15

Merge-request: !3650
parents edca8d5c a2454793
......@@ -124,6 +124,22 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
elseif(CMAKE_C_PLATFORM_ID MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1)
endif()
else()
if(NOT DEFINED CMAKE_C_COMPILER_FRONTEND_VARIANT)
# Some toolchain files set our internal CMAKE_C_COMPILER_ID_RUN
# variable but are not aware of CMAKE_C_COMPILER_FRONTEND_VARIANT.
# They pre-date our support for the GNU-like variant targeting the
# MSVC ABI so we do not consider that here.
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
else()
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU")
endif()
else()
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
endif()
endif()
endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
......
......@@ -119,6 +119,22 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
elseif(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1)
endif()
else()
if(NOT DEFINED CMAKE_CXX_COMPILER_FRONTEND_VARIANT)
# Some toolchain files set our internal CMAKE_CXX_COMPILER_ID_RUN
# variable but are not aware of CMAKE_CXX_COMPILER_FRONTEND_VARIANT.
# They pre-date our support for the GNU-like variant targeting the
# MSVC ABI so we do not consider that here.
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "MSVC")
else()
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU")
endif()
else()
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
endif()
endif()
endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
......
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