~aleteoryx/muditaos

ref: 8f10062943c56c47580a51f33dde0f7eabd88fde muditaos/module-lwip/CMakeLists.txt -rw-r--r-- 1.2 KiB
8f100629 — Alek Rudnik [EGD-6836] Fix VSC TestMate configuration 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
project(module-lwip VERSION 1.0 DESCRIPTION "LwIP port layer")

include(${CMAKE_CURRENT_SOURCE_DIR}/lwip-includes.cmake)

set (SOURCES
    "${LWIP_DIR}/contrib/ports/freertos/sys_arch.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/lib/dhcp-server/dhserver.c"
)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set (LWIP_DEFINITIONS LWIP_DEBUG=1)
endif()

include(${LWIP_DIR}/src/Filelists.cmake)
include(${LWIP_DIR}/contrib/Filelists.cmake)

# for any target dependent on lwip
# target_include_directories(<app> PRIVATE ${LWIP_INCLUDE_DIRS})

# add to target
set(LWIP_LIBRARIES lwipcontribapps lwipallapps lwipcore)

### TODO maybe make it a bit shared
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${BOARD_DIR_SOURCES})
target_compile_definitions(${PROJECT_NAME} PUBLIC   ${PROJECT_CONFIG_DEFINITIONS}
                                                    ${PROJECT_TARGET}
                                                    ${BOARD_DIR_DEFINITIONS}
                                                    )

target_include_directories(
    ${PROJECT_NAME}
    PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${LWIP_INCLUDE_DIRS}
)

target_link_libraries(
    ${PROJECT_NAME}
    module-bsp
    module-utils
    module-vfs
    module-sys
    ${BOARD_DIR_LIBRARIES}
    ${LWIP_LIBRARIES}
    )