skullc-peripherals/Tests/CMakeLists.txt
Erki 2fcdd83124
All checks were successful
continuous-integration/drone/push Build is passing
Add Peripheerals/Button module
2021-04-17 23:30:46 +03:00

29 lines
750 B
CMake

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
option(TESTS_WITH_SANITIZERS "Enable sanitizers for tests." ON)
find_package(Catch2 REQUIRED)
if(TESTS_WITH_SANITIZERS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fno-sanitize-recover")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fno-sanitize-recover")
endif()
add_executable(tests
main.cpp
ringbuffer.cpp
packet.cpp
parser.cpp
button.cpp)
target_link_libraries(tests
PUBLIC
skullc::utility
skullc::messaging
skullc::peripherals
Catch2::Catch2
)
include(CTest)
include(Catch)
catch_discover_tests(tests)