1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:07:35 +00:00

Lagom: Various fixes to make Lagom run on OSS-Fuzz (#4176)

This commit is contained in:
DavidKorczynski 2020-11-27 22:57:02 +00:00 committed by GitHub
parent 83f6b8bc9a
commit ff8ac60184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 52 deletions

View file

@ -1,12 +1,18 @@
function(add_simple_fuzzer name)
add_executable(${name} "${name}.cpp")
target_compile_options(${name}
if (ENABLE_OSS_FUZZ)
target_link_libraries(${name}
PUBLIC Lagom)
else()
target_compile_options(${name}
PRIVATE $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
)
target_link_libraries(${name}
target_link_libraries(${name}
PUBLIC Lagom
PRIVATE $<$<C_COMPILER_ID:Clang>:-fsanitize=fuzzer>
)
endif()
endfunction()
add_simple_fuzzer(FuzzBMPLoader)
@ -22,6 +28,7 @@ add_simple_fuzzer(FuzzPPMLoader)
add_simple_fuzzer(FuzzJs)
add_simple_fuzzer(FuzzMarkdown)
if (NOT ENABLE_OSS_FUZZ)
add_executable(FuzzilliJs FuzzilliJs.cpp)
target_compile_options(FuzzilliJs
PRIVATE $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize-coverage=trace-pc-guard>
@ -30,3 +37,4 @@ target_link_libraries(FuzzilliJs
PUBLIC Lagom
PRIVATE $<$<C_COMPILER_ID:Clang>:-fsanitize-coverage=trace-pc-guard>
)
endif()