Browse Source

use the standalone runner when LIB_FUZZING_ENGINE is not set

pull/583/head
Chris Wolfe 5 years ago
parent
commit
f3925dcb52
1 changed files with 18 additions and 3 deletions
  1. +18
    -3
      fuzz/CMakeLists.txt

+ 18
- 3
fuzz/CMakeLists.txt View File

@@ -7,10 +7,25 @@ include_directories(PUBLIC ${CMAKE_SOURCE_DIR})
foreach(FUZZERNAME
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)

Loading…
Cancel
Save