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)
2020option (CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF )
2121option (CMARK_THREADING "Add locks around static accesses" OFF )
2222
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+
2331add_subdirectory (src)
2432add_subdirectory (extensions)
2533if (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")
3030 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic" )
3131endif ()
3232
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-
3833set (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)
124124 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
125125endif ()
126126
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-
132127if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
133128 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
134129endif ()
Original file line number Diff line number Diff line change @@ -208,11 +208,6 @@ if(MSVC AND MSVC_VERSION LESS 1800)
208208 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP" )
209209endif ()
210210
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-
216211if (CMAKE_BUILD_TYPE STREQUAL "Ubsan" )
217212 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined" )
218213endif ()
You can’t perform that action at this time.
0 commit comments