1195972f6Sopenharmony_ci# This file is indended to be included in end-user CMakeLists.txt 2195972f6Sopenharmony_ci# include(/path/to/Filelists.cmake) 3195972f6Sopenharmony_ci# It assumes the variable LWIP_DIR is defined pointing to the 4195972f6Sopenharmony_ci# root path of lwIP sources. 5195972f6Sopenharmony_ci# 6195972f6Sopenharmony_ci# This file is NOT designed (on purpose) to be used as cmake 7195972f6Sopenharmony_ci# subdir via add_subdirectory() 8195972f6Sopenharmony_ci# The intention is to provide greater flexibility to users to 9195972f6Sopenharmony_ci# create their own targets using the *_SRCS variables. 10195972f6Sopenharmony_ci 11195972f6Sopenharmony_ciset(LWIP_VERSION_MAJOR "2") 12195972f6Sopenharmony_ciset(LWIP_VERSION_MINOR "1") 13195972f6Sopenharmony_ciset(LWIP_VERSION_REVISION "3") 14195972f6Sopenharmony_ci# LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases 15195972f6Sopenharmony_ci# LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions 16195972f6Sopenharmony_ci# Numbers 1..31 are reserved for release candidates 17195972f6Sopenharmony_ciset(LWIP_VERSION_RC "LWIP_RC_RELEASE") 18195972f6Sopenharmony_ci 19195972f6Sopenharmony_ciif ("${LWIP_VERSION_RC}" STREQUAL "LWIP_RC_RELEASE") 20195972f6Sopenharmony_ci set(LWIP_VERSION_STRING 21195972f6Sopenharmony_ci "${LWIP_VERSION_MAJOR}.${LWIP_VERSION_MINOR}.${LWIP_VERSION_REVISION}" 22195972f6Sopenharmony_ci ) 23195972f6Sopenharmony_cielseif ("${LWIP_VERSION_RC}" STREQUAL "LWIP_RC_DEVELOPMENT") 24195972f6Sopenharmony_ci set(LWIP_VERSION_STRING 25195972f6Sopenharmony_ci "${LWIP_VERSION_MAJOR}.${LWIP_VERSION_MINOR}.${LWIP_VERSION_REVISION}.dev" 26195972f6Sopenharmony_ci ) 27195972f6Sopenharmony_cielse ("${LWIP_VERSION_RC}" STREQUAL "LWIP_RC_RELEASE") 28195972f6Sopenharmony_ci set(LWIP_VERSION_STRING 29195972f6Sopenharmony_ci "${LWIP_VERSION_MAJOR}.${LWIP_VERSION_MINOR}.${LWIP_VERSION_REVISION}.rc${LWIP_VERSION_RC}" 30195972f6Sopenharmony_ci ) 31195972f6Sopenharmony_ciendif ("${LWIP_VERSION_RC}" STREQUAL "LWIP_RC_RELEASE") 32195972f6Sopenharmony_ci 33195972f6Sopenharmony_ci# The minimum set of files needed for lwIP. 34195972f6Sopenharmony_ciset(lwipcore_SRCS 35195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/init.c 36195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/def.c 37195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/dns.c 38195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/inet_chksum.c 39195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ip.c 40195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/mem.c 41195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/memp.c 42195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/netif.c 43195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/pbuf.c 44195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/raw.c 45195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/stats.c 46195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/sys.c 47195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/altcp.c 48195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/altcp_alloc.c 49195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/altcp_tcp.c 50195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/tcp.c 51195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/tcp_in.c 52195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/tcp_out.c 53195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/timeouts.c 54195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/udp.c 55195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/net_group.c 56195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/lowpower.c 57195972f6Sopenharmony_ci) 58195972f6Sopenharmony_ciset(lwipcore4_SRCS 59195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/autoip.c 60195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/dhcp.c 61195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/etharp.c 62195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/icmp.c 63195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/igmp.c 64195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/ip4_frag.c 65195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/ip4.c 66195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv4/ip4_addr.c 67195972f6Sopenharmony_ci) 68195972f6Sopenharmony_ciset(lwipcore6_SRCS 69195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/dhcp6.c 70195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/ethip6.c 71195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/icmp6.c 72195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/inet6.c 73195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/ip6.c 74195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/ip6_addr.c 75195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/ip6_frag.c 76195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/mld6.c 77195972f6Sopenharmony_ci ${LWIP_DIR}/src/core/ipv6/nd6.c 78195972f6Sopenharmony_ci) 79195972f6Sopenharmony_ci 80195972f6Sopenharmony_ci# APIFILES: The files which implement the sequential and socket APIs. 81195972f6Sopenharmony_ciset(lwipapi_SRCS 82195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/api_lib.c 83195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/api_msg.c 84195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/err.c 85195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/if_api.c 86195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/netbuf.c 87195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/netdb.c 88195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/netifapi.c 89195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/sockets.c 90195972f6Sopenharmony_ci ${LWIP_DIR}/src/api/tcpip.c 91195972f6Sopenharmony_ci) 92195972f6Sopenharmony_ci 93195972f6Sopenharmony_ci# Files implementing various generic network interface functions 94195972f6Sopenharmony_ciset(lwipnetif_SRCS 95195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ethernet.c 96195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/bridgeif.c 97195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/bridgeif_fdb.c 98195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/slipif.c 99195972f6Sopenharmony_ci) 100195972f6Sopenharmony_ci 101195972f6Sopenharmony_ci# 6LoWPAN 102195972f6Sopenharmony_ciset(lwipsixlowpan_SRCS 103195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/lowpan6_common.c 104195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/lowpan6.c 105195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/lowpan6_ble.c 106195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/zepif.c 107195972f6Sopenharmony_ci) 108195972f6Sopenharmony_ci 109195972f6Sopenharmony_ci# PPP 110195972f6Sopenharmony_ciset(lwipppp_SRCS 111195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/auth.c 112195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/ccp.c 113195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/chap-md5.c 114195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/chap_ms.c 115195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/chap-new.c 116195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/demand.c 117195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/eap.c 118195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/ecp.c 119195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/eui64.c 120195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/fsm.c 121195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/ipcp.c 122195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/ipv6cp.c 123195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/lcp.c 124195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/magic.c 125195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/mppe.c 126195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/multilink.c 127195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/ppp.c 128195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/pppapi.c 129195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/pppcrypt.c 130195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/pppoe.c 131195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/pppol2tp.c 132195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/pppos.c 133195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/upap.c 134195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/utils.c 135195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/vj.c 136195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/polarssl/arc4.c 137195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/polarssl/des.c 138195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/polarssl/md4.c 139195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/polarssl/md5.c 140195972f6Sopenharmony_ci ${LWIP_DIR}/src/netif/ppp/polarssl/sha1.c 141195972f6Sopenharmony_ci) 142195972f6Sopenharmony_ci 143195972f6Sopenharmony_ci# SNMPv3 agent 144195972f6Sopenharmony_ciset(lwipsnmp_SRCS 145195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_asn1.c 146195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_core.c 147195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2.c 148195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_icmp.c 149195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_interfaces.c 150195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_ip.c 151195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_snmp.c 152195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_system.c 153195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_tcp.c 154195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_mib2_udp.c 155195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_snmpv2_framework.c 156195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_snmpv2_usm.c 157195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_msg.c 158195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmpv3.c 159195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_netconn.c 160195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_pbuf_stream.c 161195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_raw.c 162195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_scalar.c 163195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_table.c 164195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_threadsync.c 165195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmp_traps.c 166195972f6Sopenharmony_ci) 167195972f6Sopenharmony_ci 168195972f6Sopenharmony_ci# HTTP server + client 169195972f6Sopenharmony_ciset(lwiphttp_SRCS 170195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/http/altcp_proxyconnect.c 171195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/http/fs.c 172195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/http/http_client.c 173195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/http/httpd.c 174195972f6Sopenharmony_ci) 175195972f6Sopenharmony_ci 176195972f6Sopenharmony_ci# MAKEFSDATA HTTP server host utility 177195972f6Sopenharmony_ciset(lwipmakefsdata_SRCS 178195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/http/makefsdata/makefsdata.c 179195972f6Sopenharmony_ci) 180195972f6Sopenharmony_ci 181195972f6Sopenharmony_ci# IPERF server 182195972f6Sopenharmony_ciset(lwipiperf_SRCS 183195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/lwiperf/lwiperf.c 184195972f6Sopenharmony_ci) 185195972f6Sopenharmony_ci 186195972f6Sopenharmony_ci# SMTP client 187195972f6Sopenharmony_ciset(lwipsmtp_SRCS 188195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/smtp/smtp.c 189195972f6Sopenharmony_ci) 190195972f6Sopenharmony_ci 191195972f6Sopenharmony_ci# SNTP client 192195972f6Sopenharmony_ciset(lwipsntp_SRCS 193195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/sntp/sntp.c 194195972f6Sopenharmony_ci) 195195972f6Sopenharmony_ci 196195972f6Sopenharmony_ci# MDNS responder 197195972f6Sopenharmony_ciset(lwipmdns_SRCS 198195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/mdns/mdns.c 199195972f6Sopenharmony_ci) 200195972f6Sopenharmony_ci 201195972f6Sopenharmony_ci# NetBIOS name server 202195972f6Sopenharmony_ciset(lwipnetbios_SRCS 203195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/netbiosns/netbiosns.c 204195972f6Sopenharmony_ci) 205195972f6Sopenharmony_ci 206195972f6Sopenharmony_ci# TFTP server files 207195972f6Sopenharmony_ciset(lwiptftp_SRCS 208195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/tftp/tftp_server.c 209195972f6Sopenharmony_ci) 210195972f6Sopenharmony_ci 211195972f6Sopenharmony_ci# MQTT client files 212195972f6Sopenharmony_ciset(lwipmqtt_SRCS 213195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/mqtt/mqtt.c 214195972f6Sopenharmony_ci) 215195972f6Sopenharmony_ci 216195972f6Sopenharmony_ci# ARM MBEDTLS related files of lwIP rep 217195972f6Sopenharmony_ciset(lwipmbedtls_SRCS 218195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/altcp_tls/altcp_tls_mbedtls.c 219195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c 220195972f6Sopenharmony_ci ${LWIP_DIR}/src/apps/snmp/snmpv3_mbedtls.c 221195972f6Sopenharmony_ci) 222195972f6Sopenharmony_ci 223195972f6Sopenharmony_ci# All LWIP files without apps 224195972f6Sopenharmony_ciset(lwipnoapps_SRCS 225195972f6Sopenharmony_ci ${lwipcore_SRCS} 226195972f6Sopenharmony_ci ${lwipcore4_SRCS} 227195972f6Sopenharmony_ci ${lwipcore6_SRCS} 228195972f6Sopenharmony_ci ${lwipapi_SRCS} 229195972f6Sopenharmony_ci ${lwipnetif_SRCS} 230195972f6Sopenharmony_ci ${lwipsixlowpan_SRCS} 231195972f6Sopenharmony_ci ${lwipppp_SRCS} 232195972f6Sopenharmony_ci) 233195972f6Sopenharmony_ci 234195972f6Sopenharmony_ci# LWIPAPPFILES: All LWIP APPs 235195972f6Sopenharmony_ciset(lwipallapps_SRCS 236195972f6Sopenharmony_ci ${lwipsnmp_SRCS} 237195972f6Sopenharmony_ci ${lwiphttp_SRCS} 238195972f6Sopenharmony_ci ${lwipiperf_SRCS} 239195972f6Sopenharmony_ci ${lwipsmtp_SRCS} 240195972f6Sopenharmony_ci ${lwipsntp_SRCS} 241195972f6Sopenharmony_ci ${lwipmdns_SRCS} 242195972f6Sopenharmony_ci ${lwipnetbios_SRCS} 243195972f6Sopenharmony_ci ${lwiptftp_SRCS} 244195972f6Sopenharmony_ci ${lwipmqtt_SRCS} 245195972f6Sopenharmony_ci ${lwipmbedtls_SRCS} 246195972f6Sopenharmony_ci) 247195972f6Sopenharmony_ci 248195972f6Sopenharmony_ci# Generate lwip/init.h (version info) 249195972f6Sopenharmony_ciconfigure_file(${LWIP_DIR}/src/include/lwip/init.h.cmake.in ${LWIP_DIR}/src/include/lwip/init.h) 250195972f6Sopenharmony_ci 251195972f6Sopenharmony_ci# Documentation 252195972f6Sopenharmony_ciset(DOXYGEN_DIR ${LWIP_DIR}/doc/doxygen) 253195972f6Sopenharmony_ciset(DOXYGEN_OUTPUT_DIR output) 254195972f6Sopenharmony_ciset(DOXYGEN_IN ${LWIP_DIR}/doc/doxygen/lwip.Doxyfile.cmake.in) 255195972f6Sopenharmony_ciset(DOXYGEN_OUT ${LWIP_DIR}/doc/doxygen/lwip.Doxyfile) 256195972f6Sopenharmony_ciconfigure_file(${DOXYGEN_IN} ${DOXYGEN_OUT}) 257195972f6Sopenharmony_ci 258195972f6Sopenharmony_cifind_package(Doxygen) 259195972f6Sopenharmony_ciif (DOXYGEN_FOUND) 260195972f6Sopenharmony_ci message("Doxygen build started") 261195972f6Sopenharmony_ci 262195972f6Sopenharmony_ci add_custom_target(lwipdocs 263195972f6Sopenharmony_ci COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOXYGEN_DIR}/${DOXYGEN_OUTPUT_DIR}/html 264195972f6Sopenharmony_ci COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} 265195972f6Sopenharmony_ci WORKING_DIRECTORY ${DOXYGEN_DIR} 266195972f6Sopenharmony_ci COMMENT "Generating API documentation with Doxygen" 267195972f6Sopenharmony_ci VERBATIM) 268195972f6Sopenharmony_cielse (DOXYGEN_FOUND) 269195972f6Sopenharmony_ci message("Doxygen needs to be installed to generate the doxygen documentation") 270195972f6Sopenharmony_ciendif (DOXYGEN_FOUND) 271195972f6Sopenharmony_ci 272195972f6Sopenharmony_ci# lwIP libraries 273195972f6Sopenharmony_ciadd_library(lwipcore EXCLUDE_FROM_ALL ${lwipnoapps_SRCS}) 274195972f6Sopenharmony_citarget_compile_options(lwipcore PRIVATE ${LWIP_COMPILER_FLAGS}) 275195972f6Sopenharmony_citarget_compile_definitions(lwipcore PRIVATE ${LWIP_DEFINITIONS} ${LWIP_MBEDTLS_DEFINITIONS}) 276195972f6Sopenharmony_citarget_include_directories(lwipcore PRIVATE ${LWIP_INCLUDE_DIRS} ${LWIP_MBEDTLS_INCLUDE_DIRS}) 277195972f6Sopenharmony_ci 278195972f6Sopenharmony_ciadd_library(lwipallapps EXCLUDE_FROM_ALL ${lwipallapps_SRCS}) 279195972f6Sopenharmony_citarget_compile_options(lwipallapps PRIVATE ${LWIP_COMPILER_FLAGS}) 280195972f6Sopenharmony_citarget_compile_definitions(lwipallapps PRIVATE ${LWIP_DEFINITIONS} ${LWIP_MBEDTLS_DEFINITIONS}) 281195972f6Sopenharmony_citarget_include_directories(lwipallapps PRIVATE ${LWIP_INCLUDE_DIRS} ${LWIP_MBEDTLS_INCLUDE_DIRS}) 282