mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 08:10:48 +00:00
Merge topic 'intel-oneapi-std-windows' into release-3.21
a82af0e2ceMerge branch 'backport-3.20-intel-oneapi-std-windows'1c227583a4Tests: Fix RunCMake.try_compile C/CXX standards with IntelLLVM MSVC mode1c14691a86CMakeCCompilerId: Fix C standard detection in Clang and IntelLLVM MSVC mode6eea123e3aTests: Fix RunCMake.try_compile C/CXX standards with IntelLLVM MSVC mode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6328
This commit is contained in:
@@ -443,6 +443,17 @@ function(add_RunCMake_test_try_compile)
|
||||
set(CMAKE_C_STANDARD_DEFAULT 11)
|
||||
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 "")
|
||||
set(CMAKE_C_STANDARD_DEFAULT 17)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user