File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,8 @@ if(MSVC)
2929elseif (CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID} " STREQUAL "Clang" )
3030 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic" )
3131endif ()
32+
33+ # On MSVC 15.0 and newer, compile with C11 standard
34+ if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910)
35+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /std:c11" )
36+ endif ()
Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ if(MSVC AND MSVC_VERSION LESS 1800)
125125 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
126126endif ()
127127
128+ # On MSVC 15.0 and newer, compile with C11 standard
129+ if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910)
130+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /std:c11" )
131+ endif ()
132+
128133if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
129134 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
130135endif ()
Original file line number Diff line number Diff line change @@ -204,6 +204,11 @@ if(MSVC AND MSVC_VERSION LESS 1800)
204204 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
205205endif ()
206206
207+ # On MSVC 15.0 and newer, compile with C11 standard
208+ if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910)
209+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /std:c11" )
210+ endif ()
211+
207212if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
208213 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
209214endif ()
You can’t perform that action at this time.
0 commit comments