diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 19:56:09 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 19:56:09 +0300 |
| commit | 7fb132859fda54aa96bc9dd46d302b343eeb5a02 (patch) | |
| tree | b43ae77d7451fb470a260c03349a1caf2846c5e5 /neozip/test/fuzz/CMakeLists.txt | |
| parent | b1e34e861b5d732afe828d58aad2c638135061fd (diff) | |
| parent | c2712b8a345191f6ed79558c089777df94590087 (diff) | |
| download | Project-Tick-7fb132859fda54aa96bc9dd46d302b343eeb5a02.tar.gz Project-Tick-7fb132859fda54aa96bc9dd46d302b343eeb5a02.zip | |
Add 'neozip/' from commit 'c2712b8a345191f6ed79558c089777df94590087'
git-subtree-dir: neozip
git-subtree-mainline: b1e34e861b5d732afe828d58aad2c638135061fd
git-subtree-split: c2712b8a345191f6ed79558c089777df94590087
Diffstat (limited to 'neozip/test/fuzz/CMakeLists.txt')
| -rw-r--r-- | neozip/test/fuzz/CMakeLists.txt | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/neozip/test/fuzz/CMakeLists.txt b/neozip/test/fuzz/CMakeLists.txt new file mode 100644 index 0000000000..a02f57d21b --- /dev/null +++ b/neozip/test/fuzz/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.14...4.2.1) + +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + if(DEFINED ENV{LIB_FUZZING_ENGINE}) + set(FUZZING_ENGINE $ENV{LIB_FUZZING_ENGINE}) + set(FUZZING_ENGINE_FOUND ON) + else() + find_library(FUZZING_ENGINE "FuzzingEngine") + endif() +endif() + +set(FUZZERS + fuzzer_checksum + fuzzer_compress + fuzzer_example_small + fuzzer_example_large + fuzzer_example_flush + fuzzer_example_dict + ) + +if(WITH_GZFILEOP) + list(APPEND FUZZERS fuzzer_minigzip) +endif() + +foreach(FUZZER ${FUZZERS}) + add_executable(${FUZZER} ${FUZZER}.c) + + if(NOT FUZZING_ENGINE_FOUND) + target_sources(${FUZZER} PRIVATE standalone_fuzz_target_runner.c) + endif() + + if(NOT DEFINED BUILD_SHARED_LIBS) + target_link_libraries(${FUZZER} zlib-ng-static) + else() + target_link_libraries(${FUZZER} zlib-ng) + endif() + + if(FUZZING_ENGINE_FOUND) + target_link_libraries(${FUZZER} ${FUZZING_ENGINE}) + endif() + + file(GLOB FUZZER_TEST_FILES ${PROJECT_SOURCE_DIR}/*) + set(FUZZER_COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${FUZZER}> ${FUZZER_TEST_FILES}) + add_test(NAME ${FUZZER} COMMAND ${FUZZER_COMMAND}) +endforeach() |
