You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.5 KiB

# This file is indended to be included in end-user CMakeLists.txt
# include(/path/to/Filelists.cmake)
# It assumes the variable LWIP_CONTRIB_DIR is defined pointing to the
# root path of lwIP contrib sources.
#
# This file is NOT designed (on purpose) to be used as cmake
# subdir via add_subdirectory()
# The intention is to provide greater flexibility to users to
# create their own targets using the *_SRCS variables.
set(lwipcontribportunix_SRCS
${LWIP_CONTRIB_DIR}/ports/unix/port/sys_arch.c
${LWIP_CONTRIB_DIR}/ports/unix/port/perf.c
)
set(lwipcontribportunixnetifs_SRCS
${LWIP_CONTRIB_DIR}/ports/unix/port/netif/tapif.c
${LWIP_CONTRIB_DIR}/ports/unix/port/netif/list.c
${LWIP_CONTRIB_DIR}/ports/unix/port/netif/sio.c
${LWIP_CONTRIB_DIR}/ports/unix/port/netif/fifo.c
)
add_library(lwipcontribportunix EXCLUDE_FROM_ALL ${lwipcontribportunix_SRCS} ${lwipcontribportunixnetifs_SRCS})
target_include_directories(lwipcontribportunix PRIVATE "${WPDPACK_DIR}/include")
target_compile_options(lwipcontribportunix PRIVATE ${LWIP_COMPILER_FLAGS})
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
find_library(LIBUTIL util)
find_library(LIBPTHREAD pthread)
find_library(LIBRT rt)
target_link_libraries(lwipcontribportunix PUBLIC ${LIBUTIL} ${LIBPTHREAD} ${LIBRT})
endif()
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Darwin doesn't have pthreads or POSIX real-time extensions libs
find_library(LIBUTIL util)
target_link_libraries(lwipcontribportunix PUBLIC ${LIBUTIL})
endif()