File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -113,14 +113,6 @@ else()
113113 # that uses CMAKE_CONFIGURATION_TYPES and not CMAKE_BUILD_TYPE
114114endif ()
115115
116- IF (BUILD_FUZZERS AND NOT USE_STANDALONE_FUZZERS)
117- # The actual sanitizer link target will be added when linking the fuzz
118- # targets.
119- set (CMAKE_REQUIRED_FLAGS "-fsanitize=fuzzer-no-link" )
120- add_c_flag(-fsanitize=fuzzer-no -link)
121- unset (CMAKE_REQUIRED_FLAGS)
122- endif ()
123-
124116#
125117# Subdirectories
126118#
@@ -137,13 +129,8 @@ if(BUILD_EXAMPLES)
137129endif ()
138130
139131if (BUILD_FUZZERS)
140- if (NOT USE_STANDALONE_FUZZERS)
141- if (BUILD_EXAMPLES)
142- message (FATAL_ERROR "Cannot build the fuzzer targets and the examples together" )
143- endif ()
144- if (BUILD_TESTS)
145- message (FATAL_ERROR "Cannot build the fuzzer targets and the tests together" )
146- endif ()
132+ if ((BUILD_TESTS OR BUILD_EXAMPLES) AND NOT USE_STANDALONE_FUZZERS)
133+ message (FATAL_ERROR "Cannot build the fuzzer and the tests or examples together" )
147134 endif ()
148135 add_subdirectory (fuzzers)
149136endif ()
Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ include_directories(${LIBGIT2_INCLUDES})
33include_directories (SYSTEM ${LIBGIT2_SYSTEM_INCLUDES} )
44
55if (BUILD_FUZZERS AND NOT USE_STANDALONE_FUZZERS)
6+ set (CMAKE_REQUIRED_FLAGS "-fsanitize=fuzzer-no-link" )
67 add_c_flag(-fsanitize=fuzzer)
8+ add_c_flag(-fsanitize=fuzzer-no -link)
9+ unset (CMAKE_REQUIRED_FLAGS)
710endif ()
811
912file (GLOB SRC_FUZZ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_fuzzer.c)
You can’t perform that action at this time.
0 commit comments