2015-03-30 22:09:51 +00:00
|
|
|
set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
# Disable the coverage and sanitizer instrumentation for the fuzzer itself.
|
2016-02-18 02:02:40 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O2 -fno-sanitize=all -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters ")
|
2015-04-06 16:09:13 +00:00
|
|
|
if( LLVM_USE_SANITIZE_COVERAGE )
|
2015-05-22 22:35:31 +00:00
|
|
|
add_library(LLVMFuzzerNoMainObjects OBJECT
|
2015-01-29 16:58:29 +00:00
|
|
|
FuzzerCrossOver.cpp
|
2015-05-22 22:35:31 +00:00
|
|
|
FuzzerInterface.cpp
|
2015-05-11 21:16:27 +00:00
|
|
|
FuzzerTraceState.cpp
|
2015-02-19 18:45:37 +00:00
|
|
|
FuzzerDriver.cpp
|
2015-01-29 16:58:29 +00:00
|
|
|
FuzzerIO.cpp
|
|
|
|
FuzzerLoop.cpp
|
|
|
|
FuzzerMutate.cpp
|
2015-02-06 19:52:07 +00:00
|
|
|
FuzzerSanitizerOptions.cpp
|
2015-05-14 22:41:49 +00:00
|
|
|
FuzzerSHA1.cpp
|
2016-02-26 21:33:56 +00:00
|
|
|
FuzzerTracePC.cpp
|
2015-01-29 16:58:29 +00:00
|
|
|
FuzzerUtil.cpp
|
|
|
|
)
|
2015-05-22 22:35:31 +00:00
|
|
|
add_library(LLVMFuzzerNoMain STATIC
|
|
|
|
$<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
|
|
|
|
)
|
2015-12-16 02:14:57 +00:00
|
|
|
if( HAVE_LIBPTHREAD )
|
|
|
|
target_link_libraries(LLVMFuzzerNoMain pthread)
|
|
|
|
endif()
|
2015-01-30 23:26:57 +00:00
|
|
|
add_library(LLVMFuzzer STATIC
|
|
|
|
FuzzerMain.cpp
|
2015-05-22 22:35:31 +00:00
|
|
|
$<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
|
2015-01-30 23:26:57 +00:00
|
|
|
)
|
2015-12-16 02:14:57 +00:00
|
|
|
if( HAVE_LIBPTHREAD )
|
|
|
|
target_link_libraries(LLVMFuzzer pthread)
|
|
|
|
endif()
|
2015-01-29 16:58:29 +00:00
|
|
|
|
|
|
|
if( LLVM_INCLUDE_TESTS )
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
|
|
|
endif()
|