-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
35 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
# Copyright (c) 2019, Paul Dreik | ||
# License: see LICENSE.rst in the fmt root directory | ||
|
||
# settings this links in a main. useful for reproducing, | ||
# kcov, gdb, afl, valgrind. | ||
# (note that libFuzzer can also reproduce, just pass it the files) | ||
option(FMT_FUZZ_LINKMAIN "enables the reproduce mode, instead of libFuzzer" On) | ||
# Link in the main function. Useful for reproducing, kcov, gdb, afl, valgrind. | ||
# (Note that libFuzzer can also reproduce, just pass it the files.) | ||
option(FMT_FUZZ_LINKMAIN "Enables the reproduce mode, instead of libFuzzer" On) | ||
|
||
# For oss-fuzz - insert $LIB_FUZZING_ENGINE into the link flags, but only for | ||
# the fuzz targets, otherwise the cmake configuration step fails. | ||
# the fuzz targets, otherwise the CMake configuration step fails. | ||
set(FMT_FUZZ_LDFLAGS "" CACHE STRING "LDFLAGS for the fuzz targets") | ||
|
||
# Find all fuzzers. | ||
set(SOURCES | ||
chrono_duration.cpp | ||
named_arg.cpp | ||
one_arg.cpp | ||
two_args.cpp | ||
) | ||
|
||
macro(implement_fuzzer sourcefile) | ||
get_filename_component(basename ${sourcefile} NAME_WE) | ||
function(add_fuzzer source) | ||
get_filename_component(basename ${source} NAME_WE) | ||
set(name fuzzer_${basename}) | ||
add_executable(${name} ${sourcefile} fuzzer_common.h) | ||
add_executable(${name} ${source} fuzzer-common.h) | ||
if (FMT_FUZZ_LINKMAIN) | ||
target_sources(${name} PRIVATE main.cpp) | ||
target_sources(${name} PRIVATE main.cc) | ||
endif () | ||
target_link_libraries(${name} PRIVATE fmt) | ||
if (FMT_FUZZ_LDFLAGS) | ||
target_link_libraries(${name} PRIVATE ${FMT_FUZZ_LDFLAGS}) | ||
endif () | ||
if (FMT_FUZZ_LDFLAGS) | ||
target_link_libraries(${name} PRIVATE ${FMT_FUZZ_LDFLAGS}) | ||
endif () | ||
target_compile_features(${name} PRIVATE cxx_generic_lambdas) | ||
endmacro () | ||
endfunction() | ||
|
||
foreach (X IN ITEMS ${SOURCES}) | ||
implement_fuzzer(${X}) | ||
foreach (source chrono-duration.cc named-arg.cc one-arg.cc two-args.cc) | ||
add_fuzzer(${source}) | ||
endforeach () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters