CMakeLists.txt 581 Bytes
Newer Older
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  message(FATAL_ERROR "You need to build with Clang for fuzzing to work")
endif()

add_library(aec_fuzz STATIC ${libaec_SRCS})
add_executable(fuzz_target fuzz_target.cc)

set(FUZZ_TARGET_LINK_FLAGS "-fsanitize=address")
set(FUZZ_TARGET_COMPILE_FLAGS
  "-g"
  "-fsanitize=address"
  "-fsanitize-coverage=trace-pc-guard,indirect-calls,edge")
set_target_properties(fuzz_target aec_fuzz PROPERTIES
  LINK_FLAGS ${FUZZ_TARGET_LINK_FLAGS}
  COMPILE_OPTIONS "${FUZZ_TARGET_COMPILE_FLAGS}")

target_link_libraries(fuzz_target aec_fuzz Fuzzer)