aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/FindClangFuzzer.cmake32
-rw-r--r--tests/fuzz/CMakeLists.txt16
2 files changed, 10 insertions, 38 deletions
diff --git a/cmake/Modules/FindClangFuzzer.cmake b/cmake/Modules/FindClangFuzzer.cmake
deleted file mode 100644
index 55dbf734..00000000
--- a/cmake/Modules/FindClangFuzzer.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-# - Try to find Fuzzer
-# Once done this will define
-#
-# CLANG_FUZZER_FOUND - system has Fuzzer
-# CLANG_FUZZER_LIBRARY - Link these to use Fuzzer
-#
-#=============================================================================
-# Copyright (c) 2018 Andreas Schneider <asn@cryptomilk.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-#
-
-find_package(Clang REQUIRED CONFIG)
-
-find_library(CLANG_FUZZER_LIBRARY
- NAMES
- Fuzzer
- HINTS
- ${LLVM_LIBRARY_DIR}/clang/${LLVM_PACKAGE_VERSION}/lib
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Fuzzer DEFAULT_MSG CLANG_FUZZER_LIBRARY)
-
-# show the CLANG_FUZZER_LIBRARY variables only in the advanced view
-mark_as_advanced(CLANG_FUZZER_LIBRARY)
diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
index b34ca66a..c3e350be 100644
--- a/tests/fuzz/CMakeLists.txt
+++ b/tests/fuzz/CMakeLists.txt
@@ -1,9 +1,13 @@
project(fuzzing CXX)
-find_package(ClangFuzzer)
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ add_executable(ssh_server_fuzzer ssh_server_fuzzer.cpp)
+ set_target_properties(ssh_server_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
- ${CLANG_FUZZER_LIBRARY}
- ${LIBSSH_THREADS_STATIC_LIBRARY}
- ${LIBSSH_THREADS_LINK_LIBRARIES})
+ target_link_libraries(ssh_server_fuzzer
+ ${LIBSSH_THREADS_STATIC_LIBRARY}
+ ${LIBSSH_THREADS_LINK_LIBRARIES})
+endif()