diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-18 11:59:08 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-18 13:56:10 +0000 |
| commit | 150c05a2989ec5e50768718686c2c997b95af0df (patch) | |
| tree | c5f832733d7ae58b862493edb7230df5fc30e9ea /CMakeLists.txt | |
| parent | b107decdaf7a49e3cc4b6f6f37c004cd8e2b5119 (diff) | |
| download | puzzles-150c05a2989ec5e50768718686c2c997b95af0df.zip puzzles-150c05a2989ec5e50768718686c2c997b95af0df.tar.gz puzzles-150c05a2989ec5e50768718686c2c997b95af0df.tar.bz2 puzzles-150c05a2989ec5e50768718686c2c997b95af0df.tar.xz | |
Support Honggfuzz's persistent mode in fuzzpuzz
Unlike AFL, Honggfuzz's compiler wrapper doesn't provide a convenient
preprocessor macro, so we have to have CMake detect the existence of
HF_ITER. Also the resulting program can't run outside of Honggfuzz, so
maybe some additional cleverness is called for there as well. Still, it
makes Honggfuzz go ten times faster, which is nice.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 226d1e5..f7bab9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,10 +275,15 @@ cliprogram(penrose-vector-test penrose.c COMPILE_DEFINITIONS TEST_VECTORS) cliprogram(sort-test sort.c COMPILE_DEFINITIONS SORT_TEST) cliprogram(tree234-test tree234.c COMPILE_DEFINITIONS TEST) -write_generated_games_header() -cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources} - COMPILE_DEFINITIONS COMBINED) if(build_cli_programs) + write_generated_games_header() + include(CheckFunctionExists) + check_function_exists(HF_ITER HAVE_HF_ITER) + if(HAVE_HF_ITER) + add_definitions(-DHAVE_HF_ITER) + endif() + cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources} + COMPILE_DEFINITIONS COMBINED) target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir}) endif() |