mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:07:44 +00:00
CMake: Allow building fuzzing targets without libFuzzer or OSS-Fuzz
This commit is contained in:
parent
e3519b8e5c
commit
bf502ae3b0
4 changed files with 20 additions and 9 deletions
|
@ -4,7 +4,7 @@ function(add_simple_fuzzer name)
|
|||
if (ENABLE_FUZZERS_OSSFUZZ)
|
||||
target_link_libraries(${name}
|
||||
PUBLIC ${ARGN} LagomCore)
|
||||
else()
|
||||
elseif (ENABLE_FUZZERS_LIBFUZZER)
|
||||
target_compile_options(${name}
|
||||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
|
||||
)
|
||||
|
@ -63,7 +63,7 @@ add_simple_fuzzer(FuzzWasmParser LagomWasm)
|
|||
add_simple_fuzzer(FuzzZip LagomArchive)
|
||||
add_simple_fuzzer(FuzzZlibDecompression LagomCompress)
|
||||
|
||||
if (NOT ENABLE_FUZZERS_OSSFUZZ)
|
||||
if (ENABLE_FUZZERS_LIBFUZZER)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${ORIGINAL_CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${ORIGINAL_CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${ORIGINAL_CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue