Skip to content

Commit

Permalink
libethdrivers: cleanup network stack usage
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider committed Feb 29, 2024
1 parent bdbf329 commit 0a0afbc
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions libethdrivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@ mark_as_advanced(
LibEthdriverPreallocatedBufSize
LibEthdriverPicoTCBAsyncDriver
)

# Create ethdrivers_Config
add_config_library(ethdrivers "${configure_string}")

add_library(
ethdrivers
STATIC
EXCLUDE_FROM_ALL
"src/helpers.c"
"src/virtio_pci.c"
)

if(KernelPlatformImx8mq-evk)
# Re-use the imx6 sources
set(PlatPrefix "imx6")
Expand All @@ -83,10 +93,8 @@ file(
src/plat/${PlatPrefix}/*.c
src/plat/${PlatPrefix}/uboot/*.c
src/plat/${PlatPrefix}/cpsw/*.c
src/*.c
)

add_library(ethdrivers STATIC EXCLUDE_FROM_ALL ${sources})
target_sources(ethdrivers PRIVATE ${sources})

target_include_directories(
ethdrivers
Expand All @@ -99,21 +107,23 @@ target_link_libraries(
muslc
platsupport
ethdrivers_Config
lwip_Config
picotcp_Config
sel4_autoconf
)
if(LibLwip)
target_link_libraries(ethdrivers lwip)
endif()
if(LibPicotcp)
target_link_libraries(ethdrivers picotcp)
endif()

if(KernelPlatformTx2)
target_link_libraries(ethdrivers platsupportports)
endif()

if(LibLwip)
target_sources(ethdrivers "src/lwip.c")
target_link_libraries(ethdrivers lwip lwip_Config)
endif()

if(LibPicotcp)
target_sources(ethdrivers "src/pico_dev_eth.c")
target_link_libraries(ethdrivers picotcp picotcp_Config)
endif()

# Provide the driver modules by forcing the linker to put these symbols in the
# library, instead of discarding them as unused.
set(
Expand Down

0 comments on commit 0a0afbc

Please sign in to comment.