aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0937d25..ceb4756 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -282,6 +282,16 @@ if(build_cli_programs)
cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources}
COMPILE_DEFINITIONS COMBINED $<$<BOOL:${HAVE_HF_ITER}>:HAVE_HF_ITER>)
target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir})
+
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+ cliprogram(fuzzpuzz-libfuzzer fuzzpuzz.c list.c ${puzzle_sources}
+ COMPILE_DEFINITIONS COMBINED OMIT_MAIN)
+ target_include_directories(fuzzpuzz-libfuzzer
+ PRIVATE ${generated_include_dir})
+ target_compile_options(fuzzpuzz-libfuzzer PRIVATE -fsanitize=fuzzer)
+ set_target_properties(fuzzpuzz-libfuzzer
+ PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
+ endif()
endif()
build_extras()