mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Lagom: Copy fuzzer dictionary files to Oss-Fuzz $OUT
directory
When building fuzzers for Oss-Fuzz using `BuildFuzzers.sh --oss-fuzz`, fuzzer dictionary files are now copied to the `$OUT` directory. This allows them to be used automatically by the corresponding fuzzer.
This commit is contained in:
parent
33ad384a7d
commit
7d717986de
Notes:
sideshowbarker
2024-07-16 23:08:48 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/7d717986de Pull-request: https://github.com/SerenityOS/serenity/pull/21806
2 changed files with 6 additions and 2 deletions
|
@ -72,6 +72,7 @@ if [ "$#" -gt "0" ] && [ "--oss-fuzz" = "$1" ] ; then
|
||||||
-DBUILD_LAGOM=ON \
|
-DBUILD_LAGOM=ON \
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DENABLE_FUZZERS_OSSFUZZ=ON \
|
-DENABLE_FUZZERS_OSSFUZZ=ON \
|
||||||
|
-DFUZZER_DICTIONARY_DIRECTORY="$OUT" \
|
||||||
-DCMAKE_C_COMPILER="$CC" \
|
-DCMAKE_C_COMPILER="$CC" \
|
||||||
-DCMAKE_CXX_COMPILER="$CXX" \
|
-DCMAKE_CXX_COMPILER="$CXX" \
|
||||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS -DOSS_FUZZ=ON" \
|
-DCMAKE_CXX_FLAGS="$CXXFLAGS -DOSS_FUZZ=ON" \
|
||||||
|
|
|
@ -2,8 +2,11 @@ function(add_simple_fuzzer name)
|
||||||
add_executable(${name} "${name}.cpp")
|
add_executable(${name} "${name}.cpp")
|
||||||
|
|
||||||
if (ENABLE_FUZZERS_OSSFUZZ)
|
if (ENABLE_FUZZERS_OSSFUZZ)
|
||||||
target_link_libraries(${name}
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.dict")
|
||||||
PUBLIC ${ARGN} LibCore)
|
configure_file("${name}.dict" "${FUZZER_DICTIONARY_DIRECTORY}/${name}.dict" COPYONLY)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${name}
|
||||||
|
PUBLIC ${ARGN} LibCore)
|
||||||
elseif (ENABLE_FUZZERS_LIBFUZZER)
|
elseif (ENABLE_FUZZERS_LIBFUZZER)
|
||||||
target_compile_options(${name}
|
target_compile_options(${name}
|
||||||
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
|
PRIVATE $<$<CXX_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
|
||||||
|
|
Loading…
Reference in a new issue