File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,14 @@ option(CMARK_SHARED "Build shared libcmark-gfm library" ON)
20
20
option (CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF )
21
21
option (CMARK_THREADING "Add locks around static accesses" OFF )
22
22
23
+ # set a required C standard so we can load stdbool.h
24
+ if (MSVC )
25
+ set (CMAKE_C_STANDARD 11 )
26
+ else ()
27
+ set (CMAKE_C_STANDARD 99 )
28
+ endif ()
29
+ set (CMAKE_C_STANDARD_REQUIRED YES )
30
+
23
31
add_subdirectory (src )
24
32
add_subdirectory (extensions )
25
33
if (CMARK_TESTS AND (CMARK_SHARED OR CMARK_STATIC ))
Original file line number Diff line number Diff line change @@ -30,9 +30,4 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
30
30
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic" )
31
31
endif ()
32
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 ()
37
-
38
33
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCMARK_USE_CMAKE_HEADERS" )
Original file line number Diff line number Diff line change @@ -124,11 +124,6 @@ if(MSVC AND MSVC_VERSION LESS 1800)
124
124
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
125
125
endif ()
126
126
127
- # On MSVC 15.0 and newer, compile with C11 standard
128
- if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910 )
129
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /std:c11" )
130
- endif ()
131
-
132
127
if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
133
128
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
134
129
endif ()
Original file line number Diff line number Diff line change @@ -208,11 +208,6 @@ if(MSVC AND MSVC_VERSION LESS 1800)
208
208
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
209
209
endif ()
210
210
211
- # On MSVC 15.0 and newer, compile with C11 standard
212
- if (MSVC AND MSVC_VERSION GREATER_EQUAL 1910 )
213
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /std:c11" )
214
- endif ()
215
-
216
211
if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
217
212
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
218
213
endif ()
You can’t perform that action at this time.
0 commit comments