diff --git a/libethdrivers/CMakeLists.txt b/libethdrivers/CMakeLists.txt index ba026a68..74dcd979 100644 --- a/libethdrivers/CMakeLists.txt +++ b/libethdrivers/CMakeLists.txt @@ -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") @@ -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 @@ -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(