Skip to content

Commit

Permalink
Add workaround for hardcoded paths in OSSFuzz build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Aug 22, 2024
1 parent 6264091 commit 59ab947
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,13 @@ endif()
set(TESTS_DIR ${PROJECT_SOURCE_DIR}/tests)
add_subdirectory(${TESTS_DIR})

# Fuzzer if this is moved to it's own CMakeLists.txt (as it should be)
# the OSS fuzzer build fails. And must be fixed.
# Simply because it builds the fuzzer there again with hard-coded paths.
# See: https://github.com/google/oss-fuzz/blob/master/projects/capstone/build.sh
add_executable(fuzz_disasm ${PROJECT_SOURCE_DIR}/suite/fuzz/onefile.c ${PROJECT_SOURCE_DIR}/suite/fuzz/fuzz_disasm.c ${PROJECT_SOURCE_DIR}/suite/fuzz/platform.c)
target_link_libraries(fuzz_disasm PRIVATE capstone)

source_group("Source\\Engine" FILES ${SOURCES_ENGINE})
source_group("Source\\ARM" FILES ${SOURCES_ARM})
source_group("Source\\AARCH64" FILES ${SOURCES_AARCH64})
Expand Down
3 changes: 0 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ if (CAPSTONE_BUILD_LEGACY_TESTS)
target_link_libraries(${TBIN} PRIVATE capstone)
add_test(NAME "legacy_${TBIN}" COMMAND ${TBIN})
endforeach()
# fuzz target built with the tests
add_executable(fuzz_disasm ${PROJECT_SOURCE_DIR}/suite/fuzz/onefile.c ${PROJECT_SOURCE_DIR}/suite/fuzz/fuzz_disasm.c ${PROJECT_SOURCE_DIR}/suite/fuzz/platform.c)
target_link_libraries(fuzz_disasm PRIVATE capstone)
endif()

0 comments on commit 59ab947

Please sign in to comment.