1 | # This file is indended to be included in end-user CMakeLists.txt
|
---|
2 | # include(/path/to/Filelists.cmake)
|
---|
3 | # It assumes the variable LWIP_CONTRIB_DIR is defined pointing to the
|
---|
4 | # root path of lwIP contrib sources.
|
---|
5 | #
|
---|
6 | # This file is NOT designed (on purpose) to be used as cmake
|
---|
7 | # subdir via add_subdirectory()
|
---|
8 | # The intention is to provide greater flexibility to users to
|
---|
9 | # create their own targets using the *_SRCS variables.
|
---|
10 |
|
---|
11 | set(lwipcontribportunix_SRCS
|
---|
12 | ${LWIP_CONTRIB_DIR}/ports/unix/port/sys_arch.c
|
---|
13 | ${LWIP_CONTRIB_DIR}/ports/unix/port/perf.c
|
---|
14 | )
|
---|
15 |
|
---|
16 | set(lwipcontribportunixnetifs_SRCS
|
---|
17 | ${LWIP_CONTRIB_DIR}/ports/unix/port/netif/tapif.c
|
---|
18 | ${LWIP_CONTRIB_DIR}/ports/unix/port/netif/list.c
|
---|
19 | ${LWIP_CONTRIB_DIR}/ports/unix/port/netif/sio.c
|
---|
20 | ${LWIP_CONTRIB_DIR}/ports/unix/port/netif/fifo.c
|
---|
21 | )
|
---|
22 |
|
---|
23 | add_library(lwipcontribportunix EXCLUDE_FROM_ALL ${lwipcontribportunix_SRCS} ${lwipcontribportunixnetifs_SRCS})
|
---|
24 | target_include_directories(lwipcontribportunix PRIVATE ${LWIP_INCLUDE_DIRS} ${LWIP_MBEDTLS_INCLUDE_DIRS})
|
---|
25 | target_compile_options(lwipcontribportunix PRIVATE ${LWIP_COMPILER_FLAGS})
|
---|
26 | target_compile_definitions(lwipcontribportunix PRIVATE ${LWIP_DEFINITIONS} ${LWIP_MBEDTLS_DEFINITIONS})
|
---|
27 | target_link_libraries(lwipcontribportunix PUBLIC ${LWIP_MBEDTLS_LINK_LIBRARIES})
|
---|
28 |
|
---|
29 | if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
---|
30 | find_library(LIBUTIL util)
|
---|
31 | find_library(LIBPTHREAD pthread)
|
---|
32 | find_library(LIBRT rt)
|
---|
33 | target_link_libraries(lwipcontribportunix PUBLIC ${LIBUTIL} ${LIBPTHREAD} ${LIBRT})
|
---|
34 | endif()
|
---|
35 |
|
---|
36 | if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
---|
37 | # Darwin doesn't have pthreads or POSIX real-time extensions libs
|
---|
38 | find_library(LIBUTIL util)
|
---|
39 | target_link_libraries(lwipcontribportunix PUBLIC ${LIBUTIL})
|
---|
40 | endif()
|
---|