fuzzing NEW refactor harness to enable LLVM LibFuzzer and more granular fuzzing

Refactor the harness to call LLVMFuzzerTestOneInput when using
AFL, and simultaneously enable standalone fuzzing with LibFuzzer,
which disables the main function of the harness, and uses
LLVMFuzzerTestOneInput directly.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e87269..d80ef4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -418,6 +418,13 @@
 endif(ENABLE_BUILD_TESTS)
 
 if(ENABLE_FUZZ_TARGETS)
+	set(FUZZER "AFL" CACHE STRING "fuzzer type")
+	if(FUZZER STREQUAL "LibFuzzer")
+		if (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+			message(FATAL_ERROR "LibFuzzer works only with clang")
+		endif()
+		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,undefined")
+	endif()
 	add_subdirectory(tests/fuzz)
 endif(ENABLE_FUZZ_TARGETS)