Enable asserts in fuzz target

This commit is contained in:
2024-05-29 22:00:18 -07:00
parent 10b032076e
commit 16c2bb1d11
3 changed files with 22 additions and 29 deletions

View File

@@ -62,7 +62,9 @@ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
add_subdirectory(third_party)
add_executable(versioned_map_main VersionedMap.cpp RootSet.cpp)
set(SOURCES VersionedMap.cpp RootSet.cpp)
add_executable(versioned_map_main ${SOURCES})
target_include_directories(versioned_map_main
PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(versioned_map_main PRIVATE nanobench)
@@ -73,7 +75,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_options(versioned_map_main PRIVATE -fsanitize=address,undefined)
endif()
add_library(${PROJECT_NAME}-object OBJECT VersionedMap.cpp RootSet.cpp)
add_library(${PROJECT_NAME}-object OBJECT ${SOURCES})
target_compile_options(${PROJECT_NAME}-object PRIVATE -fno-exceptions -fno-rtti)
target_include_directories(${PROJECT_NAME}-object
@@ -155,11 +157,11 @@ if(BUILD_TESTING)
cmake_pop_check_state()
if(HAS_LIB_FUZZER)
add_executable(facade_fuzz FacadeFuzz.cpp)
target_link_libraries(facade_fuzz PRIVATE ${PROJECT_NAME})
add_executable(facade_fuzz FacadeFuzz.cpp ${SOURCES})
target_include_directories(facade_fuzz
PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_compile_options(facade_fuzz PRIVATE ${FUZZ_FLAGS} ${TEST_FLAGS})
target_link_options(facade_fuzz PRIVATE ${FUZZ_FLAGS} -fsanitize=fuzzer)
endif()
endif()