Don't build samples and tests to save time when fuzzing
This commit is contained in:
@ -1145,6 +1145,19 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
if(UNICORN_FUZZ)
|
||||
set(UNICORN_FUZZ_SUFFIX "arm_arm;arm_armbe;arm_thumb;arm64_arm;arm64_armbe;m68k_be;mips_32be;mips_32le;sparc_32be;x86_16;x86_32;x86_64")
|
||||
set(SAMPLES_LIB ${SAMPLES_LIB} rt)
|
||||
foreach(SUFFIX ${UNICORN_FUZZ_SUFFIX})
|
||||
add_executable(fuzz_emu_${SUFFIX}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/fuzz/fuzz_emu_${SUFFIX}.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/fuzz/onedir.c
|
||||
)
|
||||
target_link_libraries(fuzz_emu_${SUFFIX}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
endforeach()
|
||||
else()
|
||||
foreach(SAMPLE_FILE ${UNICORN_SAMPLE_FILE})
|
||||
add_executable(${SAMPLE_FILE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/samples/${SAMPLE_FILE}.c
|
||||
@ -1163,23 +1176,6 @@ foreach(TEST_FILE ${UNICORN_TEST_FILE})
|
||||
)
|
||||
add_test(${TEST_FILE} ${TEST_FILE})
|
||||
endforeach(TEST_FILE)
|
||||
|
||||
if(UNICORN_FUZZ)
|
||||
set(UNICORN_FUZZ_SUFFIX "arm_arm;arm_armbe;arm_thumb;arm64_arm;arm64_armbe;m68k_be;mips_32be;mips_32le;sparc_32be;x86_16;x86_32;x86_64")
|
||||
set(SAMPLES_LIB ${SAMPLES_LIB} rt)
|
||||
foreach(SUFFIX ${UNICORN_FUZZ_SUFFIX})
|
||||
add_executable(fuzz_emu_${SUFFIX}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/fuzz/fuzz_emu_${SUFFIX}.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/fuzz/onedir.c
|
||||
)
|
||||
target_link_libraries(fuzz_emu_${SUFFIX}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
# oss-fuzz requires statically linked executables.
|
||||
target_link_options(fuzz_emu_${SUFFIX} PRIVATE
|
||||
-static
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
|
Reference in New Issue
Block a user