blob: 736950dd39619bdc813c2a21760c54216cb489df [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 Ballmanf77031f2015-04-06 16:09:13 +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 Serebryany22526252015-05-11 21:16:27 +00007 FuzzerTraceState.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()