FTXUI/cmake/ftxui_fuzzer.cmake
Arthur Sonzogni 65848d1e5f
cmake: support gtest from the package manager (#552)
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/551
2023-01-14 20:37:42 +01:00

28 lines
542 B
CMake

if (FTXUI_BUILD_TESTS_FUZZER)
return()
endif()
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
function(fuzz name)
add_executable(${name}
src/ftxui/component/${name}.cpp
)
target_include_directories(${name}
PRIVATE src
)
target_link_libraries(${name}
PRIVATE component
)
target_compile_options(${name}
PRIVATE -fsanitize=fuzzer,address
)
target_link_libraries(${name}
PRIVATE -fsanitize=fuzzer,address
)
endfunction(fuzz)
fuzz(terminal_input_parser_test_fuzzer)
fuzz(component_fuzzer)