mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
MSVC: Enable C23 language support
Introduced support via `-std:clatest` in cl 19.39.
This commit is contained in:
committed by
Brad King
parent
58fc19e5c4
commit
0d758be222
@@ -1,4 +1,4 @@
|
||||
set(CMake_TEST_C_STANDARDS "90;99;11;17" CACHE STRING "")
|
||||
set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
|
||||
set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
|
||||
|
||||
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
|
||||
|
||||
@@ -33,6 +33,16 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27)
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.39)
|
||||
# VS 17.10 did not have a "stdclatest" value for LanguageStandard_C.
|
||||
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio"
|
||||
OR CMAKE_VS_VERSION_BUILD_NUMBER VERSION_GREATER_EQUAL 17.11)
|
||||
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std:clatest")
|
||||
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std:clatest")
|
||||
set(CMAKE_C_STANDARD_LATEST 23)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(C 19.27 99)
|
||||
else()
|
||||
# MSVC has no specific options to set C language standards, but set them as
|
||||
|
||||
Reference in New Issue
Block a user