2018-02-04 11:49:13 +01:00
|
|
|
project(fuzzing CXX)
|
|
|
|
|
2020-04-27 18:44:14 +02:00
|
|
|
macro(fuzzer name)
|
|
|
|
add_executable(${name} ${name}.cpp)
|
|
|
|
target_link_libraries(${name}
|
2019-02-02 16:28:38 +01:00
|
|
|
PRIVATE
|
2019-11-06 09:06:05 +01:00
|
|
|
ssh::static)
|
2020-04-27 18:44:14 +02:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
set_target_properties(${name}
|
|
|
|
PROPERTIES
|
|
|
|
COMPILE_FLAGS "-fsanitize=fuzzer"
|
|
|
|
LINK_FLAGS "-fsanitize=fuzzer")
|
|
|
|
# Run the fuzzer to make sure it works
|
|
|
|
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name} -runs=1)
|
|
|
|
else()
|
|
|
|
target_sources(${name} PRIVATE fuzzer.c)
|
|
|
|
# Run the fuzzer to make sure it works
|
|
|
|
# add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name} EXAMPLE)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
2019-02-02 16:28:38 +01:00
|
|
|
|
2020-04-27 18:44:14 +02:00
|
|
|
fuzzer(ssh_client_fuzzer)
|
|
|
|
fuzzer(ssh_server_fuzzer)
|