mirror of
https://github.com/swiftlang/swift-cmark.git
synced 2026-01-18 17:31:20 +01:00
build: only build the fuzzer when appropriate
This is a test binary, only build it if testing is enabled.
This commit is contained in:
@@ -176,12 +176,3 @@ endif()
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
if(CMARK_LIB_FUZZER)
|
||||
add_executable(cmark-fuzz ../test/cmark-fuzz.c ${LIBRARY_SOURCES})
|
||||
target_link_libraries(cmark-fuzz "${CMAKE_LIB_FUZZER_PATH}")
|
||||
# cmark is written in C but the libFuzzer runtime is written in C++ which
|
||||
# needs to link against the C++ runtime.
|
||||
set_target_properties(cmark-fuzz PROPERTIES
|
||||
LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
@@ -92,3 +92,15 @@ else(Python3_Interpreter_FOUND)
|
||||
message(WARNING "A python 3 interpreter is required to run the spec tests")
|
||||
|
||||
endif(Python3_Interpreter_FOUND)
|
||||
|
||||
|
||||
if(CMARK_LIB_FUZZER)
|
||||
add_executable(cmark-fuzz cmark-fuzz.c)
|
||||
target_link_libraries(cmark-fuzz PRIVATE
|
||||
libcmark-gfm_static
|
||||
"${CMAKE_LIB_FUZZER_PATH}")
|
||||
# cmark is written in C but the libFuzzer runtime is written in C++ which
|
||||
# needs to link against the C++ runtime.
|
||||
set_target_properties(cmark-fuzz PROPERTIES
|
||||
LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user