aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindClangFuzzer.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-02-04 11:49:13 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-02-04 11:52:45 +0100
commit25ff1214a40531cea33a91eed6225d4f4bf51cbc (patch)
tree6a43300bf0e84762996ef54ce46b471a929831e4 /cmake/Modules/FindClangFuzzer.cmake
parentd84b0926f0ff285466d0a9d9ca631f1dfbd3a75e (diff)
downloadlibssh-25ff1214a40531cea33a91eed6225d4f4bf51cbc.tar.gz
libssh-25ff1214a40531cea33a91eed6225d4f4bf51cbc.tar.xz
libssh-25ff1214a40531cea33a91eed6225d4f4bf51cbc.zip
cmake: Build ssh_server_fuzzer if enabled
Fixes T67 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'cmake/Modules/FindClangFuzzer.cmake')
-rw-r--r--cmake/Modules/FindClangFuzzer.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmake/Modules/FindClangFuzzer.cmake b/cmake/Modules/FindClangFuzzer.cmake
new file mode 100644
index 00000000..55dbf734
--- /dev/null
+++ b/cmake/Modules/FindClangFuzzer.cmake
@@ -0,0 +1,32 @@
+# - 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)