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)
71
71
umf_option (UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF )
72
72
umf_option (UMF_BUILD_EXAMPLES "Build UMF examples" ON )
73
73
umf_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 )
75
76
umf_option (
76
77
UMF_DISABLE_HWLOC
77
78
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
@@ -579,12 +580,19 @@ if(UMF_USE_MSAN)
579
580
"prevent reporting false-positives" )
580
581
add_sanitizer_flag (memory )
581
582
endif ()
583
+
582
584
# 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 ()
588
596
endif ()
589
597
590
598
# 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:
111
111
| UMF_BUILD_GPU_TESTS | Build UMF GPU tests | ON/OFF | OFF |
112
112
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
113
113
| 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 |
115
115
| UMF_BUILD_GPU_EXAMPLES | Build UMF GPU examples | ON/OFF | OFF |
116
116
| UMF_DEVELOPER_MODE | Enable additional developer checks | ON/OFF | OFF |
117
117
| 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
391
391
LIBS ${UMF_UTILS_FOR_TEST} )
392
392
endif ()
393
393
394
- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UMF_BUILD_FUZZTESTS )
394
+ if (UMF_BUILD_FUZZTESTS )
395
395
add_subdirectory (fuzz )
396
396
endif ()
397
397
else ()
You can’t perform that action at this time.
0 commit comments