| @@ -7,10 +7,25 @@ include_directories(PUBLIC ${CMAKE_SOURCE_DIR}) | |||||
| foreach(FUZZERNAME | foreach(FUZZERNAME | ||||
| tokener_parse_ex_fuzzer) | tokener_parse_ex_fuzzer) | ||||
| add_executable(${FUZZERNAME} ${FUZZERNAME}.cc standalone_runner.cc) | |||||
| add_executable(${FUZZERNAME} | |||||
| ${FUZZERNAME}.cc) | |||||
| target_include_directories(${FUZZERNAME} PUBLIC ${PROJECT_BINARY_DIR}) | |||||
| target_include_directories(${FUZZERNAME} | |||||
| PUBLIC | |||||
| ${PROJECT_BINARY_DIR}) | |||||
| target_link_libraries(${FUZZERNAME} PRIVATE json-c) | |||||
| set_target_properties(${FUZZERNAME} PROPERTIES CXX_STANDARD 11) | |||||
| # define whether we want to use the standalone runner for our own testing or | |||||
| # link against libFuzzer populated from env variables | |||||
| if (NOT DEFINED $ENV{LIB_FUZZING_ENGINE}) | |||||
| add_library(standalone_runner standalone_runner.cc) | |||||
| target_link_libraries(${FUZZERNAME} | |||||
| json-c | |||||
| standalone_runner) | |||||
| else() | |||||
| target_link_libraries(${FUZZERNAME} | |||||
| json-c | |||||
| ${LIB_FUZZING_ENGINE}) | |||||
| endif() | |||||
| endforeach(FUZZERNAME) | endforeach(FUZZERNAME) | ||||