Merge branch 'backport-3.20-intel-oneapi-std-windows' into release-3.20

Merge-request: !6328
This commit is contained in:
Brad King
2021-07-09 11:45:00 -04:00
2 changed files with 15 additions and 3 deletions

View File

@@ -33,9 +33,8 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
#if !defined(__STDC__)
# if (defined(_MSC_VER) && !defined(__clang__)) \
|| (defined(__ibmxl__) || defined(__IBMC__))
#if !defined(__STDC__) && !defined(__clang__)
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
# define C_DIALECT "90"
# else
# define C_DIALECT

View File

@@ -420,6 +420,19 @@ function(add_RunCMake_test_try_compile)
set(CMAKE_C_STANDARD_DEFAULT "")
endif()
endif()
if(CMAKE_VERSION VERSION_LESS 3.20.6 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xIntelLLVM" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
# Older CMake versions accidentally set the default standards to empty when
# IntelLLVM targets the MSVC ABI, thus not activating standard selection.
# Approximate the logic from IntelLLVM-{C,CXX}.cmake.
if(DEFINED CMAKE_C_STANDARD_DEFAULT AND "${CMAKE_C_STANDARD_DEFAULT}" STREQUAL "")
# FIXME: The compiler actually defaults to C17, but
# CMake does not yet model or detect that standard.
set(CMAKE_C_STANDARD_DEFAULT 11)
endif()
if(DEFINED CMAKE_CXX_STANDARD_DEFAULT AND "${CMAKE_CXX_STANDARD_DEFAULT}" STREQUAL "")
set(CMAKE_CXX_STANDARD_DEFAULT 14)
endif()
endif()
foreach(var
CMAKE_SYSTEM_NAME
CMAKE_C_COMPILER_ID