blob: a0451a83ae2f25e426070c5f1565e6d361111ba7 [file] [log] [blame]
Kostya Serebryany16d03bd2015-03-30 22:09:51 +00001set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS_RELEASE}")
2# Disable the coverage and sanitizer instrumentation for the fuzzer itself.
3set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O2 -fno-sanitize=all")
Aaron Ballmanef116982015-01-29 16:58:29 +00004if( LLVM_USE_SANITIZE_COVERAGE )
Kostya Serebryany71672552015-01-30 23:26:57 +00005 add_library(LLVMFuzzerNoMain OBJECT
Aaron Ballmanef116982015-01-29 16:58:29 +00006 FuzzerCrossOver.cpp
Kostya Serebryany16d03bd2015-03-30 22:09:51 +00007 FuzzerDFSan.cpp
Kostya Serebryany016852c2015-02-19 18:45:37 +00008 FuzzerDriver.cpp
Aaron Ballmanef116982015-01-29 16:58:29 +00009 FuzzerIO.cpp
10 FuzzerLoop.cpp
Aaron Ballmanef116982015-01-29 16:58:29 +000011 FuzzerMutate.cpp
Kostya Serebryanydb4d6452015-02-06 19:52:07 +000012 FuzzerSanitizerOptions.cpp
Aaron Ballmanef116982015-01-29 16:58:29 +000013 FuzzerUtil.cpp
14 )
Kostya Serebryany71672552015-01-30 23:26:57 +000015 add_library(LLVMFuzzer STATIC
16 FuzzerMain.cpp
17 $<TARGET_OBJECTS:LLVMFuzzerNoMain>
18 )
Aaron Ballmanef116982015-01-29 16:58:29 +000019
20 if( LLVM_INCLUDE_TESTS )
21 add_subdirectory(test)
22 endif()
23endif()