From 85496d4a49f04ab46a74e68cd2d495ecc734dd12 Mon Sep 17 00:00:00 2001
From: Dmitriy Nesterov <dim.nesterov2015@gmail.com>
Date: Thu, 29 Sep 2022 13:22:32 +0300
Subject: [PATCH] test/fuzz: add options for better fuzzing

Added options for fuzzing and for getting more information
on debugging.

NO_CHANGELOG=<fuzzing options>
NO_DOC=<fuzzing options>
NO_TEST=<fuzzing options>

(cherry picked from commit 69f21e25176b41767147191f13aa89718e881cb0)
---
 test/fuzz/CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/fuzz/CMakeLists.txt b/test/fuzz/CMakeLists.txt
index c3ff4b41b3..94b4987b99 100644
--- a/test/fuzz/CMakeLists.txt
+++ b/test/fuzz/CMakeLists.txt
@@ -11,6 +11,10 @@ target_compile_options(
     INTERFACE
         $<$<NOT:$<BOOL:${OSS_FUZZ}>>:
         -fsanitize=fuzzer
+        -fsanitize-coverage=trace-cmp
+        -fprofile-instr-generate
+        -fcoverage-mapping
+        -g
         >
         $<$<BOOL:${OSS_FUZZ}>:
         ${CXX}
@@ -22,6 +26,10 @@ target_link_libraries(
     INTERFACE
         $<$<NOT:$<BOOL:${OSS_FUZZ}>>:
         -fsanitize=fuzzer
+        -fsanitize-coverage=trace-cmp
+        -fprofile-instr-generate
+        -fcoverage-mapping
+        -g
         >
         $<$<BOOL:${OSS_FUZZ}>:
         $ENV{LIB_FUZZING_ENGINE}
-- 
GitLab