Skip to content

Commit

Permalink
Be sure to compile library with fuzz support if building fuzz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lefticus committed Mar 19, 2024
1 parent b8e3946 commit a3c8b26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sample_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ target_link_libraries(sample_library PRIVATE myproject_options myproject_warning
target_include_directories(sample_library ${WARNING_GUARD} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>)

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(
Expand Down

0 comments on commit a3c8b26

Please sign in to comment.