cmake_minimum_required(VERSION 3.22)

add_library(f4ll STATIC
    src/console_handler.cpp
    src/crc_handler.cpp
    src/dma_helper.cpp
    src/fault.cpp
    src/memcpy_dma.cpp
    src/packet_usart.cpp
    src/ringbuffer.cpp
    src/str_util.cpp
    src/usart_core.cpp
)

target_include_directories(f4ll PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/inc
)

target_link_libraries(f4ll PUBLIC platform stm32cubemx)

# ST code quality workaround - Suppres register storage class warning (C++17...)
target_compile_options(f4ll PRIVATE -Wno-register)
