34 lines · plain
1set(LLVM_LINK_COMPONENTS2 Support3 )4 5add_llvm_fuzzer(lldb-commandinterpreter-fuzzer6 EXCLUDE_FROM_ALL7 lldb-commandinterpreter-fuzzer.cpp8 )9 10if(TARGET lldb-commandinterpreter-fuzzer)11 target_include_directories(lldb-commandinterpreter-fuzzer PRIVATE ..)12 target_link_libraries(lldb-commandinterpreter-fuzzer13 PRIVATE14 liblldb15 )16 17 # A directory in the build directory is created to hold the fuzzer's18 # artifacts as a pre-build command for the command interpreter's executable19 # target. When the fuzzer exits the input artifact that caused it to exit20 # will be written to this directory.21 22 add_custom_command(TARGET lldb-commandinterpreter-fuzzer PRE_BUILD23 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/fuzzer-artifacts/commandinterpreter-artifacts24 )25 26 add_custom_target(fuzz-lldb-commandinterpreter27 COMMENT "Running the LLDB command interpreter fuzzer..."28 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/fuzzer-artifacts/commandinterpreter-artifacts29 COMMAND $<TARGET_FILE:lldb-commandinterpreter-fuzzer> -dict=${CMAKE_CURRENT_SOURCE_DIR}/inputdictionary.txt -only_ascii=1 -artifact_prefix=commandinterpreter-30 USES_TERMINAL31 )32 set_target_properties(fuzz-lldb-commandinterpreter PROPERTIES FOLDER "LLDB/Fuzzer") 33endif()34