-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
84 lines (72 loc) · 2.04 KB
/
CMakeLists.txt
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
set(LWIP_POSIX_CMAKE_VERSION 3.5.1)
cmake_minimum_required(VERSION ${LWIP_POSIX_CMAKE_VERSION})
project(lwip-wasm-project
VERSION 1.0.0
DESCRIPTION "lwip-posix"
LANGUAGES C
)
include(default-cmake-options.cmake)
# ASSERTION CHECK
if (NOT DEFINED LWIP_DIR)
message(FATAL " LWIP_DIR is not defined")
endif()
if (NOT DEFINED LWIP_CORE_DIR)
message(FATAL " LWIP_CORE_DIR is not defined")
endif()
if (NOT DEFINED cmsis_DIR)
message(FATAL " cmsis_DIR is not defined")
endif()
include(${LWIP_DIR}/Filelists.cmake)
if (NOT DEFINED lwip_SRCS)
message(FATAL " lwip_SRCS is not defined")
endif()
if (NOT DEFINED lwip_core_SRCS)
message(FATAL " lwip_core_SRCS is not defined")
endif()
message(STATUS "LWIP_DIR " ${LWIP_DIR})
message(STATUS "LWIP_CORE_DIR " ${LWIP_CORE_DIR})
include(${PROJECT_SOURCE_DIR}/../../wasm-micro-runtime/core/iwasm/libraries/lib-socket/lib_socket_wasi.cmake)
add_library(
lwip STATIC
${lwip_SRCS}
${lwip_core_SRCS}
)
target_include_directories(
lwip
PRIVATE ${LWIP_DIR}/Third_Party/STM32CubeF7/Middlewares/Third_Party/LwIP/system
PRIVATE ${LWIP_DIR}/src/core
PRIVATE ${LWIP_DIR}/src/netif
PRIVATE ${LWIP_DIR}/src/include
PRIVATE ${LWIP_CORE_DIR}/src
PRIVATE ${LWIP_CORE_DIR}/src/include
PRIVATE ${LWIP_CORE_DIR}/system
PRIVATE ${cmsis_DIR}/include
PRIVATE ${PROJECT_SOURCE_DIR}/../../library/include
)
set(INSTALL_CMAKE_DIR ${PROJECT_SOURCE_DIR}/public)
install(
DIRECTORY ${LWIP_DIR}/Third_Party/STM32CubeF7/Middlewares/Third_Party/LwIP/system/arch/
DESTINATION ${INSTALL_CMAKE_DIR}/include/system/arch
)
install(
DIRECTORY ${LWIP_CORE_DIR}/src/include/
DESTINATION ${INSTALL_CMAKE_DIR}/include/lwip
)
install(
DIRECTORY ${LWIP_DIR}/src/include/
DESTINATION ${INSTALL_CMAKE_DIR}/include/posix
)
install(
TARGETS lwip
DESTINATION ${INSTALL_CMAKE_DIR}
EXPORT lwip-export
LIBRARY DESTINATION lib
INCLUDES DESTINATION include
PUBLIC_HEADER DESTINATION include
)
install(
EXPORT lwip-export
FILE lwip-config.cmake
DESTINATION ${INSTALL_CMAKE_DIR}
EXPORT_LINK_INTERFACE_LIBRARIES
)