Skip to content

Commit a3c8b26

Browse files
committed
Be sure to compile library with fuzz support if building fuzz tests
1 parent b8e3946 commit a3c8b26

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/sample_library/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ target_link_libraries(sample_library PRIVATE myproject_options myproject_warning
1212
target_include_directories(sample_library ${WARNING_GUARD} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
1313
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>)
1414

15+
if (myproject_BUILD_FUZZ_TESTS)
16+
target_link_libraries(sample_library PRIVATE -fsanitize=fuzzer-no-link)
17+
target_compile_options(sample_library PRIVATE -fsanitize=fuzzer-no-link)
18+
endif()
19+
1520
target_compile_features(sample_library PUBLIC cxx_std_${CMAKE_CXX_STANDARD})
1621

1722
set_target_properties(

0 commit comments

Comments
 (0)