diff options
author | Brad King <brad.king@kitware.com> | 2020-08-20 11:49:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-08-20 11:49:27 (GMT) |
commit | d13b010321c8f3943a8b1b9ed4f780e8fddb16e1 (patch) | |
tree | c56eebf84a7a32d6b96c0a77ed1a77dbc8057b8d | |
parent | b544a1ebec7357fd6df0025f87179c9e30e454b1 (diff) | |
parent | f4373feda85fd63b80dd357d896e23bd001578df (diff) | |
download | CMake-d13b010321c8f3943a8b1b9ed4f780e8fddb16e1.zip CMake-d13b010321c8f3943a8b1b9ed4f780e8fddb16e1.tar.gz CMake-d13b010321c8f3943a8b1b9ed4f780e8fddb16e1.tar.bz2 |
Merge topic 'msvc_c11'
f4373feda8 Tests: Fix RunCMake.try_compile test for C standards with MSVC 19.27
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5145
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a1b9d5b..bbb1952 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -366,6 +366,15 @@ function(add_RunCMake_test_try_compile) unset(CMAKE_CXX_STANDARD_DEFAULT) endif() endif() + if(CMAKE_VERSION VERSION_LESS 3.18.20200813 AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC") + # Older CMake versions do not know about MSVC language standards. + # Approximate our logic from MSVC-C.cmake. + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.27) + set(CMAKE_C_STANDARD_DEFAULT 99) + else() + set(CMAKE_C_STANDARD_DEFAULT "") + endif() + endif() foreach(var CMAKE_SYSTEM_NAME CMAKE_C_COMPILER_ID |