You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 818 B

12345678910111213141516171819202122232425
  1. # https://cmake.org/cmake/help/v3.0/command/add_test.html
  2. # https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
  3. enable_language(CXX)
  4. include_directories(PUBLIC ${CMAKE_SOURCE_DIR})
  5. include_directories(PUBLIC ${PROJECT_BINARY_DIR})
  6. if(DEFINED ENV{LIB_FUZZING_ENGINE})
  7. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LIB_FUZZING_ENGINE}")
  8. set(fuzzing_engine "")
  9. else()
  10. add_library(fuzzing_engine standalone_runner.cc)
  11. set(fuzzing_engine fuzzing_engine)
  12. endif()
  13. foreach(FUZZERNAME
  14. tokener_parse_ex_fuzzer)
  15. add_executable(${FUZZERNAME} ${FUZZERNAME}.cc)
  16. target_link_libraries(${FUZZERNAME}
  17. json-c
  18. ${fuzzing_engine})
  19. add_test(NAME test_${FUZZERNAME} COMMAND ${CMAKE_BINARY_DIR}/fuzz/${FUZZERNAME} ${CMAKE_SOURCE_DIR}/fuzz/tests/valid.json)
  20. endforeach(FUZZERNAME)