diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:56 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:56 +0900 |
commit | 7bf65aec6825377cb70a176d71f21116f1d977df (patch) | |
tree | 8f702de450f62c070f2e85157ffc8eaf25d47764 /Tests/RunCMake | |
parent | 0a793b9589edea1ea74c0bfcbfef46c1a37f7291 (diff) | |
download | cmake-7bf65aec6825377cb70a176d71f21116f1d977df.tar.gz cmake-7bf65aec6825377cb70a176d71f21116f1d977df.tar.bz2 cmake-7bf65aec6825377cb70a176d71f21116f1d977df.zip |
Imported Upstream version 3.20.6upstream/3.20.6
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index c81796cfa..95f28f673 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -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 |