File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -241,16 +241,27 @@ set(CURL_LIB_DIR ${CURL_INSTALL_DIR}/lib)
241
241
242
242
# Fuzzing engine
243
243
if (DEFINED ENV{LIB_FUZZING_ENGINE} )
244
- set (LIB_FUZZING_ENGINE $ENV{LIB_FUZZING_ENGINE} )
244
+ # Check to see if ENV{LIB_FUZZING_ENGINE} is a file. If so, use it directly.
245
+ # Otherwise, assume it's a flag to the compiler.
246
+ if (EXISTS $ENV{LIB_FUZZING_ENGINE} )
247
+ message (STATUS "Using LIB_FUZZING_ENGINE file: $ENV{LIB_FUZZING_ENGINE} " )
248
+ set (LIB_FUZZING_ENGINE $ENV{LIB_FUZZING_ENGINE} )
249
+ set (LIB_FUZZING_ENGINE_FLAG "" )
250
+ else ()
251
+ message (STATUS "Using LIB_FUZZING_ENGINE as a compiler flag: $ENV{LIB_FUZZING_ENGINE} " )
252
+ set (LIB_FUZZING_ENGINE_FLAG $ENV{LIB_FUZZING_ENGINE} )
253
+ endif ()
254
+
245
255
else ()
246
256
add_library (standaloneengine STATIC standalone_fuzz_target_runner.cc )
247
257
set_target_properties (standaloneengine PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
248
258
set (LIB_FUZZING_ENGINE ${CMAKE_BINARY_DIR} /libstandaloneengine.a )
259
+ set (LIB_FUZZING_ENGINE_FLAG "" )
249
260
endif ()
250
261
251
262
# Common sources and flags
252
263
set (COMMON_SOURCES curl_fuzzer.cc curl_fuzzer_tlv.cc curl_fuzzer_callback.cc )
253
- set (COMMON_FLAGS -g -DCURL_DISABLE_DEPRECATION )
264
+ set (COMMON_FLAGS -g -DCURL_DISABLE_DEPRECATION ${LIB_FUZZING_ENGINE_FLAG} )
254
265
set (COMMON_LINK_LIBS
255
266
${CURL_LIB_DIR} /libcurl.a
256
267
${NGHTTP2_STATIC_LIB}
You can’t perform that action at this time.
0 commit comments