Skip to content

Commit

Permalink
Add compilation support for Honggfuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
rmisev committed Oct 25, 2020
1 parent fa1e14c commit 0bb2821
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ option(URL_TEST_COVERAGE_CLANG "Build tests with Clang source-based code coverag
option(URL_TEST_SANITIZER "Build tests with Clang sanitizer" OFF)
option(URL_TEST_VALGRIND "Run tests with Valgrind" OFF)

# AFL or Clang libFuzzer
# AFL, Honggfuzz, or Clang libFuzzer
if (URL_BUILD_FUZZER)
set(URL_BUILD_TESTS OFF)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
string(REGEX MATCH "(afl-clang-fast|afl-clang)\\+\\+$" AFL ${CMAKE_CXX_COMPILER})
if (NOT AFL)
string(REGEX MATCH "hfuzz-clang\\+\\+$" HFUZZ ${CMAKE_CXX_COMPILER})
if (NOT AFL AND NOT HFUZZ)
# Clang libFuzzer
add_compile_options(-O1 -g -fsanitize=fuzzer)
add_link_options(-g -fsanitize=fuzzer)
Expand Down

0 comments on commit 0bb2821

Please sign in to comment.