Assume libFuzzer when LIB_FUZZING_ENGINE file doesn't exist

i.e. environment variable may be set, but not point to existing file
This commit is contained in:
Jon Siwek 2020-04-24 14:51:32 -07:00
parent 2ef182076e
commit a4244bc72b

View file

@ -16,7 +16,8 @@ if ( NOT DEFINED ZEEK_FUZZING_ENGINE AND DEFINED ENV{LIB_FUZZING_ENGINE} )
# Looks like a linker flag or valid file, use it
set(ZEEK_FUZZING_ENGINE "$ENV{LIB_FUZZING_ENGINE}" CACHE INTERNAL "" FORCE)
else ()
message(FATAL_ERROR "Invalid LIB_FUZZING_ENGINE: '$ENV{LIB_FUZZING_ENGINE}'")
message(WARNING "$ENV{LIB_FUZZING_ENGINE} does not exist, assume libFuzzer")
set(ZEEK_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE INTERNAL "" FORCE)
endif ()
endif ()
endif ()