@@ -13,6 +13,27 @@ project(cmark-gfm)
1313# version (the infixed `.gfm.`).
1414set (PROJECT_VERSION 0.29.0.gfm.13)
1515
16+ set (CMAKE_C_STANDARD 99)
17+ set (CMAKE_C_STANDARD_REQUIRED YES )
18+ set (CMAKE_C_EXTENSIONS NO )
19+
20+ set (CMAKE_C_VISIBILITY_PRESET hidden)
21+ set (CMAKE_VISIBILITY_INLINES_HIDDEN TRUE )
22+
23+ set (CMAKE_INCLUDE_CURRENT_DIR YES )
24+
25+ option (CMARK_FUZZ_QUADRATIC "Build quadratic fuzzing harness" OFF )
26+ option (CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF )
27+ option (CMARK_THREADING "Add locks around static accesses" OFF )
28+
29+ if ("${CMAKE_SOURCE_DIR} " STREQUAL "${CMAKE_BINARY_DIR} " )
30+ message (FATAL_ERROR "Do not build in-source.\n Please remove CMakeCache.txt and the CMakeFiles/ directory.\n Then: mkdir build ; cd build ; cmake .. ; make" )
31+ endif ()
32+ if (NOT CMAKE_BUILD_TYPE )
33+ set (CMAKE_BUILD_TYPE "Release" CACHE STRING
34+ "Choose the type of build, options are: Debug Profile Release Asan Ubsan." FORCE)
35+ endif (NOT CMAKE_BUILD_TYPE )
36+
1637list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/modules)
1738
1839include (CheckFileOffsetBits)
@@ -58,24 +79,6 @@ add_compile_definitions($<$<CONFIG:Debug>:DEBUG>)
5879
5980add_compile_options ($<$<AND :$<CONFIG:PROFILE>,$<COMPILE_LANGUAGE:C>>:-pg>)
6081
61- if ("${CMAKE_SOURCE_DIR} " STREQUAL "${CMAKE_BINARY_DIR} " )
62- message (FATAL_ERROR "Do not build in-source.\n Please remove CMakeCache.txt and the CMakeFiles/ directory.\n Then: mkdir build ; cd build ; cmake .. ; make" )
63- endif ()
64-
65- option (CMARK_LIB_FUZZER "Build libFuzzer fuzzing harness" OFF )
66- option (CMARK_THREADING "Add locks around static accesses" OFF )
67-
68- set (CMAKE_C_STANDARD 99)
69- set (CMAKE_C_STANDARD_REQUIRED YES )
70- set (CMAKE_C_EXTENSIONS NO )
71-
72- set (CMAKE_C_VISIBILITY_PRESET hidden)
73- set (CMAKE_VISIBILITY_INLINES_HIDDEN TRUE )
74-
75- set (CMAKE_INCLUDE_CURRENT_DIR YES )
76-
77- option (CMARK_FUZZ_QUADRATIC "Build quadratic fuzzing harness" OFF )
78-
7982if (CMARK_LIB_FUZZER)
8083 add_compile_options ($<$<COMPILE_LANGUAGE:C>:-fsanitize-coverage=trace-pc-guard>)
8184endif ()
@@ -89,6 +92,8 @@ if(CMARK_FUZZ_QUADRATIC)
8992 add_link_options ($<$<COMPILE_LANGUAGE:C>:-fsanitize=address>)
9093endif ()
9194
95+ check_file_offset_bits()
96+
9297add_subdirectory (src)
9398add_subdirectory (extensions)
9499# TODO(compnerd) should this be enabled for MinGW, which sets CMAKE_SYSTEM_NAME
@@ -107,7 +112,3 @@ endif()
107112export (TARGETS libcmark-gfm libcmark-gfm-extensions
108113 FILE cmark-gfmConfig.cmake)
109114
110- if (NOT CMAKE_BUILD_TYPE )
111- set (CMAKE_BUILD_TYPE "Release" CACHE STRING
112- "Choose the type of build, options are: Debug Profile Release Asan Ubsan." FORCE)
113- endif (NOT CMAKE_BUILD_TYPE )
0 commit comments