From a3c8b264b4316a10d3edafff5d9ef0cad6417820 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Tue, 19 Mar 2024 17:07:23 -0600 Subject: [PATCH] Be sure to compile library with fuzz support if building fuzz tests --- src/sample_library/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sample_library/CMakeLists.txt b/src/sample_library/CMakeLists.txt index cfe2f2b..211e6fa 100644 --- a/src/sample_library/CMakeLists.txt +++ b/src/sample_library/CMakeLists.txt @@ -12,6 +12,11 @@ target_link_libraries(sample_library PRIVATE myproject_options myproject_warning target_include_directories(sample_library ${WARNING_GUARD} PUBLIC $ $) +if (myproject_BUILD_FUZZ_TESTS) + target_link_libraries(sample_library PRIVATE -fsanitize=fuzzer-no-link) + target_compile_options(sample_library PRIVATE -fsanitize=fuzzer-no-link) +endif() + target_compile_features(sample_library PUBLIC cxx_std_${CMAKE_CXX_STANDARD}) set_target_properties(