# export all code as a static library
add_library(bsp)

# Add code to the bsp
add_subdirectory(freeRTOS)
add_subdirectory(ps7_cortexa9_0)
add_subdirectory(newlib)
add_subdirectory(hardware)

# this exports two libraries
# `lwip` for embedded use
# `lwip_xil` to use the ps eth
# the subdirectory contains mostly configuration code
# actual lwip is at ${LWIP_DIR}, to be set in main CMakeLists.txt
add_subdirectory(lwip)

target_sources(bsp PRIVATE main.c)

# bsp depends on FreeRTOS
target_link_libraries(bsp PUBLIC freertos_kernel)

# export lwip as part of bsp
target_link_libraries(bsp INTERFACE lwip)