1
1
libssh/tests/fuzz/CMakeLists.txt
Andreas Schneider 8c36a865f2 cmake: Rename static library
This is only compiled for tests and fuzzers!

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07 14:01:01 +01:00

27 строки
1014 B
CMake

project(fuzzing CXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_executable(ssh_client_fuzzer ssh_client_fuzzer.cpp)
target_link_libraries(ssh_client_fuzzer
PRIVATE
ssh::static)
set_target_properties(ssh_client_fuzzer
PROPERTIES
COMPILE_FLAGS "-fsanitize=fuzzer"
LINK_FLAGS "-fsanitize=fuzzer")
add_executable(ssh_server_fuzzer ssh_server_fuzzer.cpp)
target_link_libraries(ssh_server_fuzzer
PRIVATE
ssh::static)
set_target_properties(ssh_server_fuzzer
PROPERTIES
COMPILE_FLAGS "-fsanitize=fuzzer"
LINK_FLAGS "-fsanitize=fuzzer")
# Run the fuzzer to make sure it works
add_test(ssh_client_fuzzer ${CMAKE_CURRENT_BINARY_DIR}/ssh_client_fuzzer -runs=1)
add_test(ssh_server_fuzzer ${CMAKE_CURRENT_BINARY_DIR}/ssh_server_fuzzer -runs=1)
endif()