File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ umf_option(UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF)
7171umf_option(UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF )
7272umf_option(UMF_BUILD_EXAMPLES "Build UMF examples" ON )
7373umf_option(UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF )
74- umf_option(UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF )
74+ umf_option(UMF_BUILD_FUZZTESTS
75+ "Build UMF fuzz tests (supported only on Linux with Clang)" OFF )
7576umf_option(
7677 UMF_DISABLE_HWLOC
7778 "Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
@@ -579,12 +580,19 @@ if(UMF_USE_MSAN)
579580 "prevent reporting false-positives" )
580581 add_sanitizer_flag(memory)
581582endif ()
583+
582584# Fuzzer instrumentation for the whole library
583- if (UMF_BUILD_FUZZTESTS
584- AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"
585- AND LINUX)
586- add_compile_options ("-fsanitize=fuzzer-no-link" )
587- add_link_options ("-fsanitize=fuzzer-no-link" )
585+ if (UMF_BUILD_FUZZTESTS)
586+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND LINUX)
587+ add_compile_options ("-fsanitize=fuzzer-no-link" )
588+ add_link_options ("-fsanitize=fuzzer-no-link" )
589+ else ()
590+ message (
591+ FATAL_ERROR
592+ "UMF_BUILD_FUZZTESTS option is set, but fuzz tests are supported only on Linux with Clang"
593+ )
594+ set (UMF_BUILD_FUZZTESTS OFF )
595+ endif ()
588596endif ()
589597
590598# A header-only lib to specify include directories in transitive dependencies
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ List of options provided by CMake:
111111| UMF_BUILD_GPU_TESTS | Build UMF GPU tests | ON/OFF | OFF |
112112| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
113113| UMF_BUILD_EXAMPLES | Build UMF examples | ON/OFF | ON |
114- | UMF_BUILD_FUZZTESTS | Build UMF fuzz tests | ON/OFF | OFF |
114+ | UMF_BUILD_FUZZTESTS | Build UMF fuzz tests (supported only on Linux with Clang) | ON/OFF | OFF |
115115| UMF_BUILD_GPU_EXAMPLES | Build UMF GPU examples | ON/OFF | OFF |
116116| UMF_DEVELOPER_MODE | Enable additional developer checks | ON/OFF | OFF |
117117| UMF_FORMAT_CODE_STYLE | Add clang, cmake, and black -format-check and -format-apply targets to make | ON/OFF | OFF |
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ if(LINUX AND (NOT UMF_DISABLE_HWLOC)) # OS-specific functions are implemented
391391 LIBS ${UMF_UTILS_FOR_TEST} )
392392 endif ()
393393
394- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UMF_BUILD_FUZZTESTS)
394+ if (UMF_BUILD_FUZZTESTS)
395395 add_subdirectory (fuzz)
396396 endif ()
397397else ()
You can’t perform that action at this time.
0 commit comments